Skip to content

Commit

Permalink
feat(ordinal_prefix): improved parsing of directional prefixes/suffix…
Browse files Browse the repository at this point in the history
…es (#110)
  • Loading branch information
missinglink authored Jun 25, 2020
1 parent e618bc7 commit 269920e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions classifier/scheme/street.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,5 +317,20 @@ module.exports = [
not: ['StreetClassification', 'IntersectionClassification', 'EndTokenSingleCharacterClassification']
}
]
},
{
// West Main Street
confidence: 0.88,
Class: StreetClassification,
scheme: [
{
is: ['DirectionalClassification'],
not: ['StreetClassification', 'IntersectionClassification', 'EndTokenSingleCharacterClassification']
},
{
is: ['StreetClassification'],
not: ['DirectionalClassification']
}
]
}
]
12 changes: 12 additions & 0 deletions test/address.usa.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ const testcase = (test, common) => {
{ locality: 'Brooklyn' },
{ region: 'NY' }
])

assert('E Cesar Chavez St', [
{ street: 'E Cesar Chavez St' }
])

assert('Riverbend Club Dr Se', [
{ street: 'Riverbend Club Dr Se' }
])

assert('E William Cannon Dr', [
{ street: 'E William Cannon Dr' }
])
}

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

0 comments on commit 269920e

Please sign in to comment.