Skip to content

Commit

Permalink
feat(whosonfirst): add country classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed May 3, 2019
1 parent ddddc44 commit 97f58c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions classifier/WhosOnFirstClassifier.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const PhraseClassifier = require('./super/PhraseClassifier')
const AreaClassification = require('../classification/AreaClassification')
// const CountryClassification = require('../classification/CountryClassification')
const CountryClassification = require('../classification/CountryClassification')
// const DependencyClassification = require('../classification/DependencyClassification')
const RegionClassification = require('../classification/RegionClassification')
const LocalityClassification = require('../classification/LocalityClassification')
Expand All @@ -18,15 +18,15 @@ const placetypes = {
'region': {
files: ['abrv:eng_x_preferred.txt', 'name:eng_x_preferred.txt'],
classifications: [AreaClassification, RegionClassification]
}
},
// 'dependency': {
// files: ['wof:shortcode.txt', 'name:eng_x_preferred.txt'],
// classifications: [AreaClassification, DependencyClassification]
// },
// 'country': {
// files: ['wof:country.txt', 'wof:shortcode.txt', 'name:eng_x_preferred.txt'],
// classifications: [AreaClassification, CountryClassification]
// },
'country': {
files: ['name:eng_x_preferred.txt'],
classifications: [AreaClassification, CountryClassification]
}
}

class WhosOnFirstClassifier extends PhraseClassifier {
Expand Down
5 changes: 5 additions & 0 deletions test/addressit.usa.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ const testcase = (test, common) => {
{ locality: 'Atlanta' }, { region: 'Georgia' },
{ postcode: '31035' }
],
[
{ housenumber: '754' }, { street: 'Pharr Rd' },
{ locality: 'Atlanta' }, { country: 'Georgia' },
{ postcode: '31035' }
],
[
{ housenumber: '754' }, { street: 'Pharr Rd' },
{ locality: 'Georgia' }, { postcode: '31035' }
Expand Down

0 comments on commit 97f58c3

Please sign in to comment.