Package org.apache.uima.cas.text
Interface AnnotationFS
-
- All Superinterfaces:
AnnotationBaseFS
,FeatureStructure
- All Known Implementing Classes:
Annotation
,AnnotationImpl
,DocumentAnnotation
,SourceDocumentInformation
public interface AnnotationFS extends AnnotationBaseFS
Interface for Annotation Feature Structures.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getBegin()
Get the start position of the annotation as character offset into the text.String
getCoveredText()
Get the text covered by an annotation as a string.int
getEnd()
Get the end position of the annotation as character offset into the text.-
Methods inherited from interface org.apache.uima.cas.AnnotationBaseFS
getView
-
Methods inherited from interface org.apache.uima.cas.FeatureStructure
clone, equals, getBooleanValue, getByteValue, getCAS, getDoubleValue, getFeatureValue, getFeatureValueAsString, getFloatValue, getIntValue, getLongValue, getShortValue, getStringValue, getType, hashCode, setBooleanValue, setByteValue, setDoubleValue, setFeatureValue, setFeatureValueFromString, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue
-
-
-
-
Method Detail
-
getBegin
int getBegin()
Get the start position of the annotation as character offset into the text. The smallest possible start position is0
, the offset of the first character in the text.- Returns:
- The start position.
-
getEnd
int getEnd()
Get the end position of the annotation as character offset into the text. The end position points at the first character after the annotation, such that(getEnd()-getBegin()) == getCoveredText().length()
.- Returns:
- The end position.
-
getCoveredText
String getCoveredText()
Get the text covered by an annotation as a string. IfdocText
is your document text andannot
an annotation, thenannot.getCoveredText().equals(docText.substring(annot.getBegin(), annot.getEnd()))
.- Returns:
- String
-
-