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

Updated some german abbreviations & added support for fractional housenumbers #159

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
3 changes: 2 additions & 1 deletion classifier/HouseNumberClassifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class HouseNumberClassifier extends WordClassifier {
/^(\d{1,5})[a-zA-Z\u0400-\u04FF]?\/(\d{1,5})$/.test(span.body) || // 1/135 or 1b/135 Style
/^(\d{1,5})([nsewNSEW])(\d{1,5})[a-zA-Z]?$/.test(span.body) || // 6N23 Style (ie Kane County, IL)
/^([nsewNSEW])(\d{1,5})([nsewNSEW]\d{1,5})?$/.test(span.body) // W350N5337 or N453 Style (ie Waukesha County, WI)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing || at the end of the line here

// /^\d{1,5}(к\d{1,5})?(с\d{1,5})?$/.test(span.body) // Russian style including korpus (cyrillic к) and stroenie (cyrillic с)
/^(\d{1,5}) (\d\/\d)?$/.test(span.body) || // 3 1/4 Style (ie Immenstadt im Allgäu, Germany)
// /^\d{1,5}(к\d{1,5})?(с\d{1,5})?$/.test(span.body) // Russian style including korpus (cyrillic к) and stroenie (cyrillic с)
) {
let confidence = 1
let prev = span.graph.findOne('prev')
Expand Down
18 changes: 18 additions & 0 deletions classifier/HouseNumberClassifier.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,24 @@ module.exports.tests.forward_slash = (test) => {
})
}

module.exports.tests.fraction_appendix = (test) => {
test('Fraction: 1 3/4', (t) => {
let s = classify('1 3/4')
t.deepEqual(s.classifications, { HouseNumberClassification: new HouseNumberClassification(1.0) })
t.end()
})
test('Fraction: 25 2/2', (t) => {
let s = classify('25 2/2')
t.deepEqual(s.classifications, { HouseNumberClassification: new HouseNumberClassification(1.0) })
t.end()
})
test('Fraction: 11 1/3', (t) => {
let s = classify('11 1/3')
t.deepEqual(s.classifications, { HouseNumberClassification: new HouseNumberClassification(1.0) })
t.end()
})
}

module.exports.tests.misc = (test) => {
test('misc: 6N23', (t) => {
let s = classify('6N23')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diplom ingenieur|dipl ing|dipl. ing.|dipl. ing
diplom kaufmann|dipl kfm|dipl. kfm.|dipl. kfm
doktor der medizin|dr med|dr. med.
doktor der philosophie|dr phil|dr. phil.
magister|mag|mag.
bachelor of science|b.sc|b sc.|bachelor Sc.|b sc|b. sc
master of science|m.sc|m sc.|master Sc.|m sc|m. sc
2 changes: 2 additions & 0 deletions resources/pelias/dictionaries/libpostal/de/near.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bei|b.
nähe|nahe|naehe|nahe gelegen
10 changes: 10 additions & 0 deletions resources/pelias/dictionaries/libpostal/de/place_names.txt
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
!ma
bahnhof|bf|b f
busbahnhof|bbf
casino|kasino
feuerwehr|fw
grundschule|gs|g s
hauptbahnhof|hbf|h b f
krankenhaus|kh|k h
nachtklub|nachtclub
polizei|pol
zahnarzt
17 changes: 17 additions & 0 deletions resources/pelias/dictionaries/libpostal/de/stopwords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
bei|b|b.
das|d|d.
dem|d|d.
den|d|d.
der|d|d.
des|d|d.
die|d|d.
fur|für|f.
gegenuber|gegenüber|ggü.|ggu|g g u|g g ü
mit|m.
nachst|nächst
uber|über
vor|v|v.
von|v|v.
zu|z|z.
zwischen|zw.|z w
zum|z|z.