From 896d14ba803f20f6256ac8520a0543125595fffe Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 24 Jun 2021 16:41:50 -0400 Subject: [PATCH] Upgrade to name-suggestion-index v6 Also bump country-coder and location-conflation --- modules/services/nsi.js | 18 +++++++++--------- package.json | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/services/nsi.js b/modules/services/nsi.js index d2881b5a2..946a9941f 100644 --- a/modules/services/nsi.js +++ b/modules/services/nsi.js @@ -1,4 +1,4 @@ -import { matcher as Matcher } from 'name-suggestion-index'; +import { Matcher } from 'name-suggestion-index'; import { fileFetcher, locationManager } from '../core'; import { presetManager } from '../presets'; @@ -40,13 +40,13 @@ const notBranches = /(coop|express|wireless|factory|outlet)/i; // function setNsiSources() { const sources = { - 'nsi_data': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/nsi.min.json', - 'nsi_dissolved': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/dissolved.min.json', - 'nsi_features': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/featureCollection.min.json', - 'nsi_generics': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/genericWords.min.json', - 'nsi_presets': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/presets/nsi-id-presets.min.json', - 'nsi_replacements': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/replacements.min.json', - 'nsi_trees': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/trees.min.json' + 'nsi_data': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/nsi.min.json', + 'nsi_dissolved': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/dissolved.min.json', + 'nsi_features': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/featureCollection.min.json', + 'nsi_generics': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/genericWords.min.json', + 'nsi_presets': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/presets/nsi-id-presets.min.json', + 'nsi_replacements': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/replacements.min.json', + 'nsi_trees': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/trees.min.json' }; let fileMap = fileFetcher.fileMap(); @@ -101,7 +101,7 @@ function loadNsiData() { ids: new Map() // Map (id -> NSI item) }; - _nsi.matcher = Matcher(); + _nsi.matcher = new Matcher(); _nsi.matcher.buildMatchIndex(_nsi.data); _nsi.matcher.buildLocationIndex(_nsi.data, locationManager.loco()); diff --git a/package.json b/package.json index 4cf95f0d9..0940568ee 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "translations": "node scripts/update_locales.js" }, "dependencies": { - "@ideditor/country-coder": "^4.1.0", - "@ideditor/location-conflation": "~0.9.0", + "@ideditor/country-coder": "~5.0.3", + "@ideditor/location-conflation": "~1.0.2", "@mapbox/geojson-area": "^0.2.2", "@mapbox/geojson-rewind": "^0.5.0", "@mapbox/sexagesimal": "1.2.0", @@ -100,7 +100,7 @@ "minimist": "^1.2.3", "mocha": "^7.0.1", "mocha-phantomjs-core": "^2.1.0", - "name-suggestion-index": "~5.0", + "name-suggestion-index": "~6.0", "node-fetch": "^2.6.1", "npm-run-all": "^4.0.0", "object-inspect": "1.9.0", @@ -127,4 +127,4 @@ "browserslist": [ "> 0.2%, last 6 major versions, Firefox ESR, IE 11, maintained node versions" ] -} \ No newline at end of file +}