Class ProvinceAssociationRule
java.lang.Object
org.opensextant.extractors.geo.rules.GeocodeRule
org.opensextant.extractors.geo.rules.ProvinceAssociationRule
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
-
Field Summary
Fields inherited from class org.opensextant.extractors.geo.rules.GeocodeRule
AVG_WORD_LEN, boundaryObserver, coordObserver, countryObserver, defaultMethod, LEX1, LEX2, locationOnly, log, LOWERCASE, NAME, textCase, UPPERCASE, weight
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
evaluate
(List<PlaceCandidate> names) Evaluate all candidate place mentions by seeing if any resolved Province contains any geo locations with the mentioned name.void
evaluate
(PlaceCandidate name, org.opensextant.data.Place geo) The one evaluation scheme that all rules must implement.boolean
Override if rule instance has another view of relevance, e.g.void
reset()
no-op, unless overriden.void
Methods inherited from class org.opensextant.extractors.geo.rules.GeocodeRule
filterByNameOnly, filterOutByFrequency, internalPlaceID, isShort, logMsg, sameBoundary, sameCountry, sameCountry, sameLexicalName, setBoundaryObserver, setCountryObserver, setDefaultMethod, setGeohash, setLocationObserver, setTextCase, textCase
-
Constructor Details
-
ProvinceAssociationRule
public ProvinceAssociationRule()
-
-
Method Details
-
reset
public void reset()Description copied from class:GeocodeRule
no-op, unless overriden.- Overrides:
reset
in classGeocodeRule
-
setProvinces
-
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 classGeocodeRule
- Returns:
-
evaluate
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 classGeocodeRule
- Parameters:
names
- list of found place names
-
evaluate
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 classGeocodeRule
- Parameters:
name
- matched name in textgeo
- gazetteer entry or location
-