Skip to content

Commit

Permalink
Also use directionals to parse Dutch street addresses. #137
Browse files Browse the repository at this point in the history
  • Loading branch information
emacgillavry authored and Joxit committed Sep 6, 2021
1 parent a0496d2 commit a5f3279
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classifier/DirectionalClassifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const libpostal = require('../resources/libpostal/libpostal')

// optionally control which languages are included
// note: reducing the languages will have a considerable performance benefit
const languages = ['en', 'es', 'de', 'fr']
const languages = ['en', 'es', 'de', 'fr', 'nl']

class DirectionalClassifier extends WordClassifier {
setup () {
Expand Down
4 changes: 4 additions & 0 deletions resources/pelias/dictionaries/libpostal/nl/directionals.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
noordzijde|nz|n.z.|n.z|n z
oostzijde|oz|o.z.|o.z|o z
westzijde|wz|w.z.|w.z|w z
zuidzijde|zz|z.z.|z.z|z z
5 changes: 2 additions & 3 deletions test/address.nld.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const testcase = (test, common) => {
[{ locality: 'Rozenburg' }],
[{ street: 'Rozenburg' }]
], false)

assert('Bloemendaal', [
[{ locality: 'Bloemendaal' }],
[{ street: 'Bloemendaal' }]
Expand All @@ -44,7 +44,7 @@ const testcase = (test, common) => {
])

assert('Oranjelaan Westzijde 41, Puttershoek', [
{ street: 'Oranjelaan Westzije' }, { housenumber: '41' }, { locality: 'Puttershoek' }
{ street: 'Oranjelaan Westzijde' }, { housenumber: '41' }, { locality: 'Puttershoek' }
])

assert('Middelstraat 18, De Moer', [
Expand All @@ -66,7 +66,6 @@ const testcase = (test, common) => {
assert('Agorabaan, Lelystad', [
{ street: 'Agorabaan' }, { locality: 'Lelystad' }
])

}

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

0 comments on commit a5f3279

Please sign in to comment.