Class NameCodeRule
java.lang.Object
org.opensextant.extractors.geo.rules.GeocodeRule
org.opensextant.extractors.geo.rules.NameCodeRule
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 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) void
evaluate
(PlaceCandidate name, org.opensextant.data.Place geo) The one evaluation scheme that all rules must implement.static boolean
isRuleFor
(PlaceCandidate name) void
reset()
no-op, unless overriden.Methods inherited from class org.opensextant.extractors.geo.rules.GeocodeRule
filterByNameOnly, filterOutByFrequency, internalPlaceID, isRelevant, isShort, logMsg, sameBoundary, sameCountry, sameCountry, sameLexicalName, setBoundaryObserver, setCountryObserver, setDefaultMethod, setGeohash, setLocationObserver, setTextCase, textCase
-
Field Details
-
NAME_ADMCODE_RULE
- See Also:
-
NAME_ADMNAME_RULE
- See Also:
-
-
Constructor Details
-
NameCodeRule
public NameCodeRule(org.opensextant.processing.Parameters p)
-
-
Method Details
-
isRuleFor
-
reset
public void reset()Description copied from class:GeocodeRule
no-op, unless overriden.- Overrides:
reset
in classGeocodeRule
-
evaluate
- 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
-