uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ekaterina Buyko <bu...@coling-uni-jena.de>
Subject Iterators in CAS
Date Fri, 12 Oct 2007 08:29:09 GMT
Hi all!

In UIMA 2.1 it is possible to create a sub-iterator in order to iterate 
over annotations which are within the begin-end span of the selected type.

For example:

AnnotationIndex sentenceIndex = (AnnotationIndex) aJCas 

AnnotationIndex tokenIndex = (AnnotationIndex) aJCas

        // iterate over Sentences
        FSIterator sentenceIterator = sentenceIndex.iterator();
        while (sentenceIterator.hasNext()) {

            Sentence sentence = (Sentence) sentenceIterator.next();

            // iterate over Tokens
            FSIterator tokenIterator = tokenIndex.subiterator(sentence);

I would like to have a more extended functionality. I need to know the 
annotations which are in the span of begin-end of the selected 
annotation type. These annotations can overlap the span of the selected 

For example noun phrases. If I iterate over tokens, I would like to 
know, if this token is inside a noun phrase or not. Now, I am working 
with Hashtables. But I am looking for an other solution.

How could I solve this problem?

Bets regards



Ekaterina Buyko
Jena University Language and Information Engineering (JULIE) Lab
Phone: +49-3641-944322
Fax:   +49-3641-944321
email: buyko@coling-uni-jena.de
URL:   http://www.julielab.de

View raw message