Class GeocoordNormalization
java.lang.Object
org.opensextant.extractors.xcoord.GeocoordNormalization
- Author:
- ubaldino
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
evaluateSpecificity
(DMSOrdinate lat, DMSOrdinate lon) Hueuristic for what style of fields are allowed in valid DD or DM/DMS coordinates.static boolean
Not all pattens might have filters.static void
normalize_coordinate
(GeocoordMatch m, Map<String, TextEntity> groups) The match object is normalized, setting the coord_text and other data from parsing "text" and knowing which pattern family was matched.static void
set the precision on a match based on the situation (match + pattern).
-
Constructor Details
-
GeocoordNormalization
public GeocoordNormalization()
-
-
Method Details
-
normalize_coordinate
public static void normalize_coordinate(GeocoordMatch m, Map<String, TextEntity> groups) throws NormalizationExceptionThe match object is normalized, setting the coord_text and other data from parsing "text" and knowing which pattern family was matched.- Parameters:
m
- matchgroups
- fields- Throws:
NormalizationException
- if entity or match is not parseable
-
filter_out
Not all pattens might have filters. This "filter_out" implies you should evaluate the MatchFilter.stop() method on any implementation.- Parameters:
m
- the match- Returns:
- true if match is invalid and should be marked as filtered out
-
evaluateSpecificity
Hueuristic for what style of fields are allowed in valid DD or DM/DMS coordinates. This evaluates if a lat/lon pair have disparate field specificity. A lat with Deg:Min should not be paired with a lon with Deg:Min:Sec:Subsec for example.- Parameters:
lat
- latitudelon
- longitude- Returns:
- true if specifity of lat and lon are reasonable.
-
set_precision
set the precision on a match based on the situation (match + pattern).- Parameters:
m
- match
-