Skip to content

Commit

Permalink
Tests, code, and configs for '-daal', '-burg', '-baan'. Addressing pe…
Browse files Browse the repository at this point in the history
  • Loading branch information
emacgillavry committed May 4, 2021
1 parent edd9c4f commit 5b8e13e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classifier/CompoundStreetClassifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ class CompoundStreetClassifier extends WordClassifier {
// this removes suffixes such as 'r.' which can be ambiguous
minlength: 3
})

libpostal.load(this.suffixes, ['de', 'nl'], 'concatenated_suffixes_inseparable.txt', {
// remove any suffixes which contain less than 3 characters (excluding a period)
// this removes suffixes such as 'r.' which can be ambiguous
minlength: 3
})
}

each (span) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
burg|brg|bg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
baan
daal
dijk
!plain|pln.
plein|pln
burg|brg|bg
15 changes: 15 additions & 0 deletions test/address.nld.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ const testcase = (test, common) => {
{ street: 'Achter Clarenburg' }, { locality: 'Utrecht' }
])

assert('Rozenburg', [
[{ locality: 'Rozenburg' }],
[{ street: 'Rozenburg' }]
], false)

assert('Bloemendaal', [
[{ locality: 'Bloemendaal' }],
[{ street: 'Bloemendaal' }]
], false)

assert('Brinkstraat 87, 7512EC, Enschede', [
{ street: 'Brinkstraat' }, { housenumber: '87' }, { postcode: '7512EC' }, { locality: 'Enschede' }
])
Expand Down Expand Up @@ -56,6 +66,11 @@ const testcase = (test, common) => {
assert('Burgemeester Martenssingel, Gouda', [
{ street: 'Burgemeester Martenssingel' }, { locality: 'Gouda' }
])

assert('Agorabaan, Lelystad', [
{ street: 'Agorabaan' }, { locality: 'Lelystad' }
])

}

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

0 comments on commit 5b8e13e

Please sign in to comment.