Package org.opensextant.processing
Class ResultsUtility
java.lang.Object
org.opensextant.processing.ResultsUtility
Abstract class encapsulating basic results formatter functionality.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatConfidence
(double d) Format confidence.static boolean
Testers for TextMatch: isDatetime macro.static boolean
Testers for TextMatch: isLocation macro.static void
setContextFor
(String content, TextEntity t, int doc_size) Given the annotation or match, set the context on the TextEntity object.static void
setPrePostContextFor
(String content, TextEntity t, int doc_size) Given the TextEntity, set the context on that object.
-
Field Details
-
TEXT_WIDTH
public static int TEXT_WIDTHThe default TEXT WIDTH. ~75 chars per line yields 2 lines of text.
-
-
Constructor Details
-
ResultsUtility
public ResultsUtility()
-
-
Method Details
-
setPrePostContextFor
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
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
Testers for TextMatch: isLocation macro.- Parameters:
m
- the m- Returns:
- true, if is location
-
isDatetime
Testers for TextMatch: isDatetime macro.- Parameters:
m
- the m- Returns:
- true, if is datetime
-
formatConfidence
Format confidence.- Parameters:
d
- the d- Returns:
- the string
-