Class GeocoordNormalization

java.lang.Object
org.opensextant.extractors.xcoord.GeocoordNormalization

public final class GeocoordNormalization extends Object
Author:
ubaldino
  • Constructor Details

    • GeocoordNormalization

      public GeocoordNormalization()
  • Method Details

    • normalize_coordinate

      public static void normalize_coordinate(GeocoordMatch m, Map<String,TextEntity> groups) throws NormalizationException
      The match object is normalized, setting the coord_text and other data from parsing "text" and knowing which pattern family was matched.
      Parameters:
      m - match
      groups - fields
      Throws:
      NormalizationException - if entity or match is not parseable
    • filter_out

      public static boolean filter_out(GeocoordMatch m)
      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

      public static boolean evaluateSpecificity(DMSOrdinate lat, DMSOrdinate lon)
      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 - latitude
      lon - longitude
      Returns:
      true if specifity of lat and lon are reasonable.
    • set_precision

      public static void set_precision(GeocoordMatch m)
      set the precision on a match based on the situation (match + pattern).
      Parameters:
      m - match