diff --git a/classifier/scheme/place.js b/classifier/scheme/place.js index 20cfe628..9e84ce1b 100644 --- a/classifier/scheme/place.js +++ b/classifier/scheme/place.js @@ -64,5 +64,20 @@ module.exports = [ not: [] } ] + }, + { + // Stop 10792 + confidence: 0.8, + Class: PlaceClassification, + scheme: [ + { + is: ['PlaceClassification'], + not: ['StreetClassification', 'IntersectionClassification', 'StopWordClassification'] + }, + { + is: ['NumericClassification'], + not: [] + } + ] } ] diff --git a/parser/AddressParser.js b/parser/AddressParser.js index ce92378c..1d832e17 100644 --- a/parser/AddressParser.js +++ b/parser/AddressParser.js @@ -84,7 +84,9 @@ class AddressParser extends Parser { ['HouseNumberClassification', 'PostcodeClassification'], ['HouseNumberClassification', 'PostcodeClassification', 'LocalityClassification'], ['HouseNumberClassification', 'PostcodeClassification', 'RegionClassification'], - ['HouseNumberClassification', 'PostcodeClassification', 'CountryClassification'] + ['HouseNumberClassification', 'PostcodeClassification', 'CountryClassification'], + ['PlaceClassification', 'HouseNumberClassification'], + ['PlaceClassification', 'PostcodeClassification'] ]), new MustNotFollowFilter('PlaceClassification', 'HouseNumberClassification'), new MustNotFollowFilter('PlaceClassification', 'StreetClassification'), diff --git a/resources/pelias/dictionaries/libpostal/en/place_names.txt b/resources/pelias/dictionaries/libpostal/en/place_names.txt index eef9f8b4..4c891545 100644 --- a/resources/pelias/dictionaries/libpostal/en/place_names.txt +++ b/resources/pelias/dictionaries/libpostal/en/place_names.txt @@ -1 +1,4 @@ -temple \ No newline at end of file +temple +cathedral +stop +!dist \ No newline at end of file diff --git a/resources/pelias/dictionaries/whosonfirst/locality/name:eng_x_preferred.txt b/resources/pelias/dictionaries/whosonfirst/locality/name:eng_x_preferred.txt index 6c2786dd..730c8aff 100644 --- a/resources/pelias/dictionaries/whosonfirst/locality/name:eng_x_preferred.txt +++ b/resources/pelias/dictionaries/whosonfirst/locality/name:eng_x_preferred.txt @@ -8,6 +8,7 @@ sf !university !hospital !temple +!cathedral !airport !deli !us diff --git a/test/transit.test.js b/test/transit.test.js new file mode 100644 index 00000000..e145c936 --- /dev/null +++ b/test/transit.test.js @@ -0,0 +1,22 @@ +const AddressParser = require('../parser/AddressParser') + +const testcase = (test, common) => { + let parser = new AddressParser() + let assert = common.assert.bind(null, test, parser) + + assert('Stop 1', [ + { place: 'Stop 1' } + ], true) + + assert('Stop 10010', [ + { place: 'Stop 10010' } + ], true) +} + +module.exports.all = (tape, common) => { + function test (name, testFunction) { + return tape(`Transit: ${name}`, testFunction) + } + + testcase(test, common) +}