...
Translations of uimaFIT select methods to the new API
select
Convenience method to iterator over all features structures of a given type.
select(FSArray, Class<T>)
Code Block | ||
---|---|---|
| ||
myArray.select(Token.class) |
select(FSList, Class<T>)
Code Block | ||
---|---|---|
| ||
myList.select(Token.class) |
...
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class) |
selectAll
Convenience method to iterator over all features structures.
selectAll(JCas)
Code Block | ||
---|---|---|
| ||
jcas.select() |
selectAt
Get all annotations of the given type at the specified offsets.
selectAt(JCas, Class<T>, int, int)
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class).at(begin, end) |
selectBetween
...
Get a list of annotations of the given annotation type located between two annotations. Does not use subiterators and does not respect type priorities. Zero-width annotations what lie on the borders are included in the result, e.g. if the boundary annotations are [1..2] and [2..3] then an annotation [2..2] is returned. If there is a non-zero overlap between the boundary annotations, the result is empty. The method properly handles cases where the second boundary annotations occurs before the first boundary annotation by switching their roles.
selectBetween(
...
Class<T>, AnnotationFS, AnnotationFS)
below.Example same as selectBetween(JCas, Class<T>, AnnotationFS, AnnotationFS) below unless we introduce a static method.
selectBetween(JCas, Class<T>, AnnotationFS, AnnotationFS)
...
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class).startAtbetween(fs1).endAt(, fs2) // thismight looksmake more likesense because we are using offsets, not index positions... jcas.select(Token.class).betweenstartAt(fs1, ).endAt(fs2) // mightthis makelooks more sense because we are using offsets, not like index positions... |
selectByIndex
selectByIndex(JCas, Class<T>, int)
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class).at(indexPosition) |
selectCovered
...
Get a list of annotations of the given annotation type constrained by a 'covering' annotation. Iterates over all annotations of the given type to find the covered annotations. Does not use subiterators.
The covering annotation is never returned itself, even if it is of the queried-for type or a subtype of that type.
selectCovered(Class<T>, AnnotationFS)
Same as selectCovered(JCas, Class<T>, AnnotationFS) below unless we introduce a static method.
...
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class).within(1,3) |
selectCovering
Get a list of annotations of the given annotation type constraint by a certain annotation. Iterates over all annotations to find the covering annotations.
selectCovering(Class<T>, AnnotationFS)
...
language | java |
---|
...
Same as selectCovering(JCas, Class<T>, AnnotationFS) below unless we introduce a static method.
selectCovering(JCas, Class<T>, AnnotationFS)
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class).containing(contextAnnotation) |
selectCovering(JCas, Class<T>, int, int)
Code Block | ||||
---|---|---|---|---|
| ||||
jcas.select(Token.class).containing(1,3) |
selectFollowing
Returns the n annotations following the given annotation.
selectFollowing(Class<T>, AnnotationFS, int)
...
language | java |
---|
...
Same as selectFollowing(JCas, Class<T>, AnnotationFS, int) below unless we introduce a static method.
selectFollowing(JCas, Class<T>, AnnotationFS, int)
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class).startAt(contextAnnotation).limit(10) |
selectPreceding
Returns the n annotations preceding the given annotation.
selectPreceding(Class<T>, AnnotationFS, int)
...
language | java |
---|
...
Same as selectPreceding(JCas, Class<T>, AnnotationFS, int) below unless we introduce a static method.
selectPreceding(JCas, Class<T>, AnnotationFS, int)
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class).startAt(contextAnnotation).reverse().limit(10)
jcas.select(Token.class).startAt(contextAnnotation).limit(-10) |
selectSingle
Get the single instance of the specified type from the JCas.
selectSingle(JCas, Class<T>)
Code Block | ||||
---|---|---|---|---|
| ||||
jcas.select(DocumentMetaData.class).single() |
selectSingleAt
Get a single annotations of the given type at the specified offsets.
selectSingleAt(JCas, Class<T>, int, int)
Code Block | ||||
---|---|---|---|---|
| ||||
jcas.select(Token.class).at(begin end).single() |
selectSingleRelative
Return an annotation preceding or following of a given reference annotation.
selectSingleRelative(Class<T>, AnnotationFS, int)
...
language | java |
---|
...
Same as selectSingleRelative(JCas, Class<T>, AnnotationFS, int) below unless we introduce a static method.
selectSingleRelative(JCas, Class<T>, AnnotationFS, int)
Code Block | ||
---|---|---|
| ||
jcas.select(Token.class).startAt(contextAnnotation).skip(10).single() jcas.select(Token.class).startAt(contextAnnotation).reverse().skip(10).single() jcas.select(Token.class).startAt(contextAnnotation).skip(-10).sinple() |