uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Eckart de Castilho <eckar...@tk.informatik.tu-darmstadt.de>
Subject Re: How to remove UIMA annotations?
Date Fri, 03 Jun 2011 13:20:25 GMT
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) {

With native UIMA native you'll have to go through the AnnotationIndex API as in your previous
code example.



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
Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de

View raw message