Package com.yahoo.text.interpretation
Class Annotations
java.lang.Object
com.yahoo.text.interpretation.Annotations
An annotation is a description of a an area of text, with a given class. For example, an annotation for the
- Author:
- Arne Bergene Fossaa
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBoolean
(String key) Helper function to get a Boolean annotation.Helper function to get a Double annotation.getInteger
(String key) Helper function to get a Double annotation.getMap()
getSpan()
The span that this annotation is for.Helper function to get a String from the Annotation.The text this annotation is for.void
Adds an annotation to the the the set of annotations.
-
Field Details
-
annotations
-
-
Constructor Details
-
Annotations
-
-
Method Details
-
put
Adds an annotation to the the the set of annotations. -
getMap
-
get
-
getSpan
The span that this annotation is for. -
getSubString
The text this annotation is for. -
getDouble
Helper function to get a Double annotation.This function first checks if the Object in a map is a
Number
, and then calls doubleValue() on it If it is not, then Double.parseDouble() is called on the string representation of the object. If the string is not parseable as a double, a NumberFormatException is thrown. -
getString
Helper function to get a String from the Annotation. This function will simply calltoString()
on the object saved in the Annotation or return null if the object is null; -
getInteger
Helper function to get a Double annotation.This function first checks if the Object in a map is a
Number
, and intValue() is called on it. If it is not, then Double.parseDouble() is called on the string representation of the object. If the string is not parseable as a double, a NumberFormatException is thrown. -
getBoolean
Helper function to get a Boolean annotation.
-