Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classifying more addresses for norway #171

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions classifier/CompoundStreetClassifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class CompoundStreetClassifier extends WordClassifier {
// load street suffixes
this.suffixes = {}

libpostal.load(this.suffixes, ['de', 'nl', 'sv'], 'concatenated_suffixes_separable.txt', {
libpostal.load(this.suffixes, ['de', 'nl', 'sv', 'nb'], '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
})

libpostal.load(this.suffixes, ['de', 'nl'], 'concatenated_suffixes_inseparable.txt', {
libpostal.load(this.suffixes, ['de', 'nl', 'nb'], '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
Expand Down
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', 'nl']
const languages = ['en', 'es', 'de', 'fr', 'nl', 'nb']

class DirectionalClassifier extends WordClassifier {
setup () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,44 @@ lia
park
plassen|pl.
stredet
mansoor-sajjad marked this conversation as resolved.
Show resolved Hide resolved
svingen
svingen
plass|pl.|p.
haugen
skogen|skog
gården|gård
åsen
haugen
skogen|skog
gården|gård
åsen
gård|gården
holm|holmen
haugen|Haugane
krysset
skogen|skog
grend|grenda
flat|flaten
våg|vågen
strand|stranda|stranden
vik|vika
platå
stad
terrasse
hage|hagen
øya
lund|lunden
holm|holmen
berg|berget
landa|lande|landet
dal|dalen
sund
bakke|bakken
høgda|høgde
borg|borgen
gard|garden|garda
mark|marka
voll|vollen
sjø|sjøen
lie
sti|stien
tangen
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
allè|alle
allèen|alleen
veg|v.
vegen|v.|vn.
vei|v.
veien|v.|vn.
veg|vegen|v.|vn.
mansoor-sajjad marked this conversation as resolved.
Show resolved Hide resolved
vei|veien|v.|vn.
10 changes: 9 additions & 1 deletion resources/libpostal/dictionaries/nb/directionals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ syd|s
sydøst|sø
sydvest|sv
vest|v
vestre
vestre
mansoor-sajjad marked this conversation as resolved.
Show resolved Hide resolved
øvre|ovre
øvste|ovste
nedre
midtre
ytre
indre
sør|sor|s
sørre|sorre
43 changes: 38 additions & 5 deletions resources/libpostal/dictionaries/nb/street_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,44 @@ gate|g|gt
gaten
lia
park
plassen|pl
plass|plassen|pl
stortorget
stredet
svingen
veg|v
vegen|v|vn
vei|v
veien|v|vn
veg|vegen|v|vn
mansoor-sajjad marked this conversation as resolved.
Show resolved Hide resolved
vei|veien|v|vn
haugen
skogen|skog
gården|gård
åsen
gård|gården
holm|holmen
haugen|Haugane
krysset
skogen|skog
grend|grenda
flat|flaten
våg|vågen
strand|stranda|stranden
vik|vika
platå
stad
terrasse
hage|hagen|hager
øya
lund|lunden
holm|holmen
berg|berget
landa|lande|landet
dal|dalen
sund
bakke|bakken
høgda|høgde
borg|borgen
gard|garden|garda
mark|marka
voll|vollen
sjø|sjøen
lie
sti|stien
tangen