Skip to content

Commit

Permalink
fix: place should not preceed unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Joxit committed May 4, 2020
1 parent fa9175a commit a6f40d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions parser/AddressParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class AddressParser extends Parser {
new MustNotPreceedFilter('CountryClassification', 'PostcodeClassification'),
new MustNotPreceedFilter('CountryClassification', 'StreetClassification'),
new MustNotPreceedFilter('CountryClassification', 'HouseNumberClassification'),
new MustNotPreceedFilter('PlaceClassification', 'UnitClassification'),
new MustNotFollowFilter('LocalityClassification', 'RegionClassification'),
new MustNotFollowFilter('LocalityClassification', 'CountryClassification'),
new HouseNumberPositionPenalty(),
Expand Down
6 changes: 6 additions & 0 deletions test/address.aus.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const testcase = (test, common) => {
{ housenumber: '345' },
{ street: 'Main St' }
])

assert('Lot 12/345 Illawarra Road Marrickville NSW 2204', [
{ unit_type: 'Lot' }, { unit: '12' }, { housenumber: '345' },
{ street: 'Illawarra Road' }, { locality: 'Marrickville' },
{ region: 'NSW' }, { postcode: '2204' }
])
}

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

0 comments on commit a6f40d1

Please sign in to comment.