Skip to content

Commit

Permalink
feat(street): Add some cases for street_name
Browse files Browse the repository at this point in the history
Remove Paris from regions and add cité in street_types.
Paris is always used as a locality
  • Loading branch information
Joxit committed May 25, 2019
1 parent 8c2d180 commit 68ca511
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
33 changes: 33 additions & 0 deletions classifier/scheme/street_name.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,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 All @@ -47,5 +65,20 @@ module.exports = [
not: ['StreetClassification', 'IntersectionClassification']
}
]
},
{
// rue des petits carreaux
confidence: 0.5,
Class: StreetNameClassification,
scheme: [
{
is: ['StreetNameClassification'],
not: ['StreetClassification', 'IntersectionClassification']
},
{
is: ['AlphaClassification'],
not: ['StreetClassification', 'IntersectionClassification']
}
]
}
]
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
16 changes: 16 additions & 0 deletions test/address.fra.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@ const testcase = (test, common) => {
assert('Rue Jean Baptiste Clément', [
{ street: 'Rue Jean Baptiste Clément' }
], true)

assert('16 Rue Des Petits Carreaux', [
{ housenumber: '16' }, { street: 'Rue Des Petits Carreaux' }
], true)

assert('16 Rue Des Petits Carreaux Paris', [
{ housenumber: '16' }, { street: 'Rue Des Petits Carreaux' }, { locality: 'Paris' }
], true)

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

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

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

0 comments on commit 68ca511

Please sign in to comment.