You copy them from the index into a list and after that you iterate over the list to remove
them from the indexes.
With uimaFIT and JCas wrappers you would write (there are similar calls for CAS in CasUtils).
// Copy the tokens into a new collection to avoid ConcurrentModificationExceptions
List<Token> tokens = new ArrayList<Token>(JCasUtils.select(jcas, Token.class));
for (Token t : tokens) {
t.removeFromIndexes();
}
With native UIMA native you'll have to go through the AnnotationIndex API as in your previous
code example.
Cheers,
Richard
Am 03.06.2011 um 14:07 schrieb Rashad:
> Ah I see.
>
> How would i go about removing ALL Token annotations?
>
> As they are useless to me as they are space tokenisers.
--
-------------------------------------------------------------------
Richard Eckart de Castilho
Technical Lead
Ubiquitous Knowledge Processing Lab
FB 20 Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany
phone [+49] (0)6151 16-7477, fax -5455, room S2/02/B117
eckartde@tk.informatik.tu-darmstadt.de
www.ukp.tu-darmstadt.de
Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de
-------------------------------------------------------------------
|