Niels Ott

Computational Linguist

UIMA Utilities

Yet another Utilities Package for UIMA

The UIMA Utilities Package available from here has been written by Niels Ott and Ramon Ziai. It came to use in several UIMA-based projects. Functions provided include a wrapper class for easy iterating over UIMA lists in foreach loops, the straightforward collection of annotations of any type from a CAS, and some more convenience candy.

Examples

Given that your type system contains a type Token that is supposed to be the annotation of linguistic tokens in a text, you can easily obtain an iterable list of tokens as follows:
List<Token> tokens = CasCollector.collectAnnotation(cas, Token.class);

To iterate over any instance or subclass of NonEmptyFSList, you can simple do the following:
NonEmptyFSList list = ...
for ( TOP item : new FSListIterable(list)) {
    // do something with item
}

System Requirements

The UIMA Utilities Package requires Java 1.5 or later and Apache UIMA.

Download

Please be aware that this package is released under the terms of the Apache License v.2.

Version History

Posted by Niels Ott • 2010-08-24