Package org.opensextant.output
Class Transforms
java.lang.Object
org.opensextant.output.Transforms
- All Implemented Interfaces:
org.opensextant.data.MatchSchema
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Cutoff confidence for geocoding results:static final String
static final String
static final String
static final String
Fields inherited from interface org.opensextant.data.MatchSchema
VAL_COORD, VAL_COUNTRY, VAL_PLACE, VAL_POSTAL, VAL_TAXON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
createGeocoding
(org.opensextant.data.Geocoding geo, jodd.json.JsonObject node) Given an existing JSON object, add geocoding metadata to it.static org.opensextant.extraction.TextMatch
parseAnnotation
(Object data) Convert JSON object for an annotation into a Xponents TextMatch instance.static void
parseDate
(org.opensextant.extractors.xtemporal.DateMatch d, jodd.json.JsonObject a) First stab at deserializing JSON date annotation.static void
parseGeocoding
(org.opensextant.data.Place geo, jodd.json.JsonObject node) Given a JSON object, parse fields relevant to the geocoding and populate that JSON data TODO: implement Parsing reverse geocoding structures related_place_name and nearest_placesstatic void
parseTaxon
(TaxonMatch x, String t, jodd.json.JsonObject a) Parse out a taxon from JSON/RESTstatic jodd.json.JsonObject
toJSON
(List<org.opensextant.extraction.TextMatch> matches, org.opensextant.processing.Parameters jobParams)
-
Field Details
-
FLD_FILTERED
- See Also:
-
FLD_TYPE
- See Also:
-
FLD_MATCH
- See Also:
-
FLD_MATCH_ID
- See Also:
-
DEFAULT_LOWER_CONFIDENCE
public static final int DEFAULT_LOWER_CONFIDENCECutoff confidence for geocoding results:- See Also:
-
-
Constructor Details
-
Transforms
public Transforms()
-
-
Method Details
-
parseAnnotation
Convert JSON object for an annotation into a Xponents TextMatch instance. Parsing data from JSON/REST representations has very limited capability compared to using Java API for processing routines directly.- Parameters:
data
-- Returns:
- TextMatch object represented by json annotation
- See Also:
-
utility and package. This Annotation approach is more general with respect to the data model overall. This Transforms utility is about transforming matches directly to JSON output ready for RESTful response.
-
parseDate
public static void parseDate(org.opensextant.extractors.xtemporal.DateMatch d, jodd.json.JsonObject a) First stab at deserializing JSON date annotation.- Parameters:
d
- datematcha
- json annot
-
parseTaxon
Parse out a taxon from JSON/REST- Parameters:
x
- a taxon objectt
- type of taxona
- JSON annotation
-
createGeocoding
public static void createGeocoding(org.opensextant.data.Geocoding geo, jodd.json.JsonObject node) Given an existing JSON object, add geocoding metadata to it.- Parameters:
geo
- geocoding objectnode
- JsonObject representing the serialized JSON for an Xlayer or other annotation.
-
parseGeocoding
public static void parseGeocoding(org.opensextant.data.Place geo, jodd.json.JsonObject node) Given a JSON object, parse fields relevant to the geocoding and populate that JSON data TODO: implement Parsing reverse geocoding structures related_place_name and nearest_places- Parameters:
geo
- geocoding objectnode
- JsonObject representing the serialized JSON for an Xlayer or other annotation.
-
toJSON
public static jodd.json.JsonObject toJSON(List<org.opensextant.extraction.TextMatch> matches, org.opensextant.processing.Parameters jobParams)
-