Skip to content

Commit

Permalink
feat(street_types): Add cité and cités to fra street types (#45)
Browse files Browse the repository at this point in the history
Remove Paris from regions (should be classified only in locality)
Add Street name with number
  • Loading branch information
Joxit authored Jun 9, 2019
1 parent 0ed71c5 commit 4aa9e3e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
18 changes: 18 additions & 0 deletions classifier/scheme/street_name.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ module.exports = [
}
]
},
{
// du 4 septembre
confidence: 0.5,
Class: StreetNameClassification,
scheme: [
{
is: ['StopWordClassification']
},
{
is: ['NumericClassification'],
not: ['PostcodeClassification']
},
{
is: ['AlphaClassification'],
not: ['StreetClassification', 'IntersectionClassification', 'LocalityClassification']
}
]
},
{
// dos Fiéis de Deus
confidence: 0.5,
Expand Down
2 changes: 2 additions & 0 deletions resources/pelias/dictionaries/libpostal/fr/street_types.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cité|cite
cités|cites
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This is not used as region
!paris
12 changes: 12 additions & 0 deletions test/address.fra.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ const testcase = (test, common) => {
assert('Mery-Sur-Oise', [
{ locality: 'Mery-Sur-Oise' }
], true)

assert('4 Cité Du Cardinal Lemoine 75005 Paris', [
{ housenumber: '4' }, { street: 'Cité Du Cardinal Lemoine' }, { postcode: '75005' }, { locality: 'Paris' }
], true)

assert('32 Rue Du 4 Septembre', [
{ housenumber: '32' }, { street: 'Rue Du 4 Septembre' }
], true)

assert('12 Cité Roland Garros', [
{ housenumber: '12' }, { street: 'Cité Roland Garros' }
], true)
}

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

0 comments on commit 4aa9e3e

Please sign in to comment.