Class ProvinceAssociationRule

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

public class ProvinceAssociationRule extends GeocodeRule
Give a list of province metadata that scopes the document, mark the list of evaluated PlaceCandidates' locations as relevant or not. Lack of association of a candidate does not down-grade any location candidate. This association only promotes matches.
Author:
ubaldino
  • Constructor Details

    • ProvinceAssociationRule

      public ProvinceAssociationRule()
  • Method Details

    • reset

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

      public void setProvinces(Collection<PlaceCount> p)
    • isRelevant

      public boolean isRelevant()
      Description copied from class: GeocodeRule
      Override if rule instance has another view of relevance, e.g. coordinate rule: no coords found, so rule.isRelevant() is FALSE.
      Overrides:
      isRelevant in class GeocodeRule
      Returns:
    • evaluate

      public void evaluate(List<PlaceCandidate> names)
      Evaluate all candidate place mentions by seeing if any resolved Province contains any geo locations with the mentioned name.
       given Bala (adm1=XU.45) province is in scope.
      
       assess the list of names = [Name1(@geo1, @geo2, @geo3)], Name2(,etc), etc];
       if any geo locations for Name1 occur also within the province of XU.45, raise the weighting of the location
       as a better answer to "where is Name1?"
       
      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