Skip to content

Commit

Permalink
feat(intersections): improved street name parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Apr 23, 2020
1 parent 4328573 commit f7b771d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classifier/scheme/street_name.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = [
scheme: [
{
is: ['StopWordClassification'],
not: ['DirectionalClassification']
not: ['DirectionalClassification', 'IntersectionClassification']
},
{
is: ['AlphaClassification', 'PersonClassification'],
Expand Down Expand Up @@ -41,7 +41,8 @@ module.exports = [
Class: StreetNameClassification,
scheme: [
{
is: ['StopWordClassification']
is: ['StopWordClassification'],
not: ['IntersectionClassification']
},
{
is: ['NumericClassification'],
Expand Down
16 changes: 16 additions & 0 deletions test/intersection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ const testcase = (test, common) => {
{ street: 'Main St' }, { street: 'Second Ave' }
])

assert('Main St and Second Ave', [
{ street: 'Main St' }, { street: 'Second Ave' }
])

assert('12th Avenue and California Street', [
{ street: '12th Avenue' }, { street: 'California Street' }
])

assert('15th Avenue and Fulton Street', [
{ street: '15th Avenue' }, { street: 'Fulton Street' }
])

assert('17th Avenue & Anza Street', [
{ street: '17th Avenue' }, { street: 'Anza Street' }
])

assert('Gleimstraße an der ecke von Schönhauser Allee', [
{ street: 'Gleimstraße' }, { street: 'Schönhauser Allee' }
])
Expand Down

0 comments on commit f7b771d

Please sign in to comment.