Package org.opensextant.processing
Class ResultsUtility
- java.lang.Object
-
- org.opensextant.processing.ResultsUtility
-
public class ResultsUtility extends java.lang.Object
Abstract class encapsulating basic results formatter functionality.
-
-
Field Summary
Fields Modifier and Type Field Description static int
TEXT_WIDTH
The default TEXT WIDTH.
-
Constructor Summary
Constructors Constructor Description ResultsUtility()
-
Method Summary
Modifier and Type Method Description static java.lang.String
formatConfidence(double d)
Format confidence.static boolean
isDatetime(TextMatch m)
Testers for TextMatch: isDatetime macro.static boolean
isLocation(TextMatch m)
Testers for TextMatch: isLocation macro.static void
setContextFor(java.lang.String content, TextEntity t, int doc_size)
Given the annotation or match, set the context on the TextEntity object.static void
setPrePostContextFor(java.lang.String content, TextEntity t, int doc_size)
Given the TextEntity, set the context on that object.
-
-
-
Method Detail
-
setPrePostContextFor
public static void setPrePostContextFor(java.lang.String content, TextEntity t, int doc_size)
Given the TextEntity, set the context on that object. The text entity must have span (start, end attributes) set.- Parameters:
content
- entire text from which entity came fromt
- the entitydoc_size
- the doc_size
-
setContextFor
public static void setContextFor(java.lang.String content, TextEntity t, int doc_size)
Given the annotation or match, set the context on the TextEntity object. The text entity must have span (start, end attributes) set.- Parameters:
content
- the contentt
- the tdoc_size
- the doc_size
-
isLocation
public static boolean isLocation(TextMatch m)
Testers for TextMatch: isLocation macro.- Parameters:
m
- the m- Returns:
- true, if is location
-
isDatetime
public static boolean isDatetime(TextMatch m)
Testers for TextMatch: isDatetime macro.- Parameters:
m
- the m- Returns:
- true, if is datetime
-
formatConfidence
public static java.lang.String formatConfidence(double d)
Format confidence.- Parameters:
d
- the d- Returns:
- the string
-
-