Upgrade to name-suggestion-index v6

Also bump country-coder and location-conflation
This commit is contained in:
Bryan Housel
2021-06-24 16:41:50 -04:00
parent 3078f95351
commit 896d14ba80
2 changed files with 13 additions and 13 deletions
+9 -9
View File
@@ -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());
+4 -4
View File
@@ -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"
]
}
}