Class PostalCodeAssociationRule
java.lang.Object
org.opensextant.extractors.geo.rules.GeocodeRule
org.opensextant.extractors.geo.rules.PostalCodeAssociationRule
- All Implemented Interfaces:
org.opensextant.data.MatchSchema
public class PostalCodeAssociationRule
extends GeocodeRule
implements org.opensextant.data.MatchSchema
-
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
Fields inherited from interface org.opensextant.data.MatchSchema
VAL_COORD, VAL_COUNTRY, VAL_PLACE, VAL_POSTAL, VAL_TAXON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
complementaryPostal
(org.opensextant.data.Place geo1, org.opensextant.data.Place geo2) Determine if you have one of each, ADM1 and POSTAL.void
evaluate
(List<PlaceCandidate> names) void
evaluate
(PlaceCandidate name, org.opensextant.data.Place geo) The one evaluation scheme that all rules must implement.void
Important - set buffer so spans for tuples can be assessed.Methods inherited from class org.opensextant.extractors.geo.rules.GeocodeRule
filterByNameOnly, filterOutByFrequency, internalPlaceID, isRelevant, isShort, logMsg, reset, sameBoundary, sameCountry, sameCountry, sameLexicalName, setBoundaryObserver, setCountryObserver, setDefaultMethod, setGeohash, setLocationObserver, setTextCase, textCase
-
Field Details
-
POSTAL_ASSOC_RULE
- See Also:
-
-
Constructor Details
-
PostalCodeAssociationRule
public PostalCodeAssociationRule()
-
-
Method Details
-
setBuffer
Important - set buffer so spans for tuples can be assessed.- Parameters:
buf
- input buffer
-
complementaryPostal
public static boolean complementaryPostal(org.opensextant.data.Place geo1, org.opensextant.data.Place geo2) Determine if you have one of each, ADM1 and POSTAL. COUNTRY and POSTAL is also fine. e.g., MA 01721 is a qualified postal code. e.g., MA MA is nonsense; it looks like two province codes together. e.g., Garden City NJ USA 01721 is fine. POSTAL code follows country. Garden City 01721 -- won't work if place is P/PPL only. Must be ADM4 or PPLA for example. 90120 01721 -- also will not work; Two postal codes next to each other. Garden City 01721-0045 -- Office park in a large metro area. That could work.- Parameters:
geo1
- place objgeo2
- place obj- Returns:
- true if place mentions complement each other.
-
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
-