Class NameCodeRule

java.lang.Object
org.opensextant.extractors.geo.rules.GeocodeRule
org.opensextant.extractors.geo.rules.NameCodeRule

public class NameCodeRule extends GeocodeRule
A rule that associates a CODE with a NAME, when the pattern "NAME, CODE" appears within N characters of each other. If CODE.adm1 == NAME.adm1 and CODE is an ADM1 boundary, then flag this is significant. TODO: expand from pairs to 2-4 tuples of related geographic hierachy, e.g., City, State, Country, etc.
Author:
ubaldino
  • Field Details

  • Constructor Details

    • NameCodeRule

      public NameCodeRule(org.opensextant.processing.Parameters p)
  • Method Details

    • isRuleFor

      public static boolean isRuleFor(PlaceCandidate name)
    • reset

      public void reset()
      Description copied from class: GeocodeRule
      no-op, unless overriden.
      Overrides:
      reset in class GeocodeRule
    • evaluate

      public void evaluate(List<PlaceCandidate> names)
      Overrides:
      evaluate in class GeocodeRule
      Parameters:
      names - list of found place names
    • evaluate

      public void evaluate(PlaceCandidate name, org.opensextant.data.Place geo)
      Description copied from class: GeocodeRule
      The one evaluation scheme that all rules must implement. Given a single text match and a location, consider if the geo is a good geocoding for the match.
      Specified by:
      evaluate in class GeocodeRule
      Parameters:
      name - matched name in text
      geo - gazetteer entry or location