mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Upgrade to name-suggestion-index v6
Also bump country-coder and location-conflation
This commit is contained in:
@@ -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
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user