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

support for places such as "Air & Space Museum" #31

Merged
merged 1 commit into from
May 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions classifier/scheme/place.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,24 @@ module.exports = [
not: []
}
]
},
{
// Air & Space Museum
confidence: 0.8,
Class: PlaceClassification,
scheme: [
{
is: ['AlphaClassification'],
not: ['StreetClassification', 'IntersectionClassification', 'StopWordClassification']
},
{
is: ['StopWordClassification'],
not: ['StreetClassification']
},
{
is: ['PlaceClassification'],
not: []
}
]
}
]
4 changes: 2 additions & 2 deletions parser/AddressParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class AddressParser extends Parser {
new CompositeClassifier(require('../classifier/scheme/person')),
new CompositeClassifier(require('../classifier/scheme/street_name')),
new CompositeClassifier(require('../classifier/scheme/street')),
new CompositeClassifier(require('../classifier/scheme/intersection')),
new CompositeClassifier(require('../classifier/scheme/place'))
new CompositeClassifier(require('../classifier/scheme/place')),
new CompositeClassifier(require('../classifier/scheme/intersection'))
],
// solvers
[
Expand Down
19 changes: 19 additions & 0 deletions test/venue.usa.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const AddressParser = require('../parser/AddressParser')

const testcase = (test, common) => {
let parser = new AddressParser()
let assert = common.assert.bind(null, test, parser)

assert('Air & Space Museum Washington DC', [
{ place: 'Air & Space Museum' },
{ locality: 'Washington' }, { region: 'DC' }
], true)
}

module.exports.all = (tape, common) => {
function test (name, testFunction) {
return tape(`USA: ${name}`, testFunction)
}

testcase(test, common)
}