Skip to content

Commit

Permalink
fix(venue_classification): follow/preceed filters after place->venue …
Browse files Browse the repository at this point in the history
…rename (#115)
  • Loading branch information
blackmad authored Aug 8, 2020
1 parent 5e6ce02 commit a65218d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
18 changes: 9 additions & 9 deletions parser/AddressParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ class AddressParser extends Parser {
['HouseNumberClassification', 'PostcodeClassification', 'LocalityClassification'],
['HouseNumberClassification', 'PostcodeClassification', 'RegionClassification'],
['HouseNumberClassification', 'PostcodeClassification', 'CountryClassification'],
['PlaceClassification', 'HouseNumberClassification'],
['PlaceClassification', 'PostcodeClassification']
['VenueClassification', 'HouseNumberClassification'],
['VenueClassification', 'PostcodeClassification']
]),
new MustNotFollowFilter('PlaceClassification', 'HouseNumberClassification'),
new MustNotFollowFilter('PlaceClassification', 'StreetClassification'),
new MustNotFollowFilter('PlaceClassification', 'LocalityClassification'),
new MustNotFollowFilter('PlaceClassification', 'RegionClassification'),
new MustNotFollowFilter('PlaceClassification', 'CountryClassification'),
new MustNotFollowFilter('PlaceClassification', 'PostcodeClassification'),
new MustNotFollowFilter('VenueClassification', 'HouseNumberClassification'),
new MustNotFollowFilter('VenueClassification', 'StreetClassification'),
new MustNotFollowFilter('VenueClassification', 'LocalityClassification'),
new MustNotFollowFilter('VenueClassification', 'RegionClassification'),
new MustNotFollowFilter('VenueClassification', 'CountryClassification'),
new MustNotFollowFilter('VenueClassification', 'PostcodeClassification'),
new MustNotPreceedFilter('PostcodeClassification', 'HouseNumberClassification'),
new MustNotPreceedFilter('PostcodeClassification', 'StreetClassification'),
new MustNotPreceedFilter('LocalityClassification', 'HouseNumberClassification'),
Expand All @@ -121,7 +121,7 @@ class AddressParser extends Parser {
new MustNotPreceedFilter('CountryClassification', 'PostcodeClassification'),
new MustNotPreceedFilter('CountryClassification', 'StreetClassification'),
new MustNotPreceedFilter('CountryClassification', 'HouseNumberClassification'),
new MustNotPreceedFilter('PlaceClassification', 'UnitClassification'),
new MustNotPreceedFilter('VenueClassification', 'UnitClassification'),
new MustNotFollowFilter('LocalityClassification', 'RegionClassification'),
new MustNotFollowFilter('LocalityClassification', 'CountryClassification'),
new HouseNumberPositionPenalty(),
Expand Down
11 changes: 11 additions & 0 deletions test/address.usa.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ const testcase = (test, common) => {
assert('E William Cannon Dr', [
{ street: 'E William Cannon Dr' }
])

// There was a bug where multiple interpretations were being
// returned for this query because "Deerfield Beach" was interpreted
// as a possible venue. This test checks for that regression.
assert('3551 W. Hillsboro Blvd Deerfield Beach, FL 33442', [[
{ housenumber: '3551' },
{ street: 'W. Hillsboro Blvd' },
{ locality: 'Deerfield Beach' },
{ region: 'FL' },
{ postcode: '33442' }
]], false)
}

module.exports.all = (tape, common) => {
Expand Down

0 comments on commit a65218d

Please sign in to comment.