Skip to content

Commit

Permalink
feat(nld): Supports nld streets (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joxit authored and missinglink committed Jun 5, 2019
1 parent 3272908 commit 7f05b8f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion classifier/CompoundStreetClassifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CompoundStreetClassifier extends WordClassifier {
// load street suffixes
this.suffixes = {}

libpostal.load(this.suffixes, ['de'], 'concatenated_suffixes_separable.txt', {
libpostal.load(this.suffixes, ['de', 'nl'], 'concatenated_suffixes_separable.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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dijk
26 changes: 26 additions & 0 deletions test/address.nld.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const AddressParser = require('../parser/AddressParser')

const testcase = (test, common) => {
let parser = new AddressParser()
let assert = common.assert.bind(null, test, parser)

assert('Julianastraat, Heel', [
{ street: 'Julianastraat' }, { locality: 'Heel' }
], true)

assert('Lindenlaan, Sint Odilienberg', [
{ street: 'Lindenlaan' }, { locality: 'Sint Odilienberg' }
], true)

assert('Bosserdijk, Hoogland', [
{ street: 'Bosserdijk' }, { locality: 'Hoogland' }
], true)
}

module.exports.all = (tape, common) => {
function test (name, testFunction) {
return tape(`address NLD: ${name}`, testFunction)
}

testcase(test, common)
}

0 comments on commit 7f05b8f

Please sign in to comment.