Class ScoredPlace

java.lang.Object
org.opensextant.extractors.geo.ScoredPlace
All Implemented Interfaces:
Comparable<ScoredPlace>

public class ScoredPlace extends Object implements Comparable<ScoredPlace>
A class to hold a Place and a score together. Used by PlaceCandidate to rank places.
Author:
dlutz, ubaldino
  • Constructor Details

    • ScoredPlace

      public ScoredPlace()
    • ScoredPlace

      public ScoredPlace(String plid, String nm)
  • Method Details

    • getPlace

      public org.opensextant.data.Place getPlace()
    • setPlace

      public void setPlace(org.opensextant.data.Place p)
    • getScore

      public double getScore()
    • incrementScore

      public void incrementScore(double d)
    • incrementScore

      public void incrementScore(double d, String rule)
      Increment the score for a given rule exactly once. TODO: expand this to allow incremental scores for Document level vs. local span-level scoring of specific location candidates.
      Parameters:
      d - score
      rule - rule name
    • hasRule

      public boolean hasRule(String r)
    • addRule

      public void addRule(String r)
    • compareTo

      public int compareTo(ScoredPlace o)
      Ordering: higher score comes first in our sortable lists. So A.score > B.score yields -1, so A is ordered first.
      Specified by:
      compareTo in interface Comparable<ScoredPlace>
    • toString

      public String toString()
      Overrides:
      toString in class Object