From 02d679a461459499e038d5fedbeec2baebf31f31 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 3 Aug 2016 21:09:21 -0700 Subject: Updating enamdict and edict, code to load dictionaries. --- ext/bg/js/dictionary.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ext/bg/js') diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js index 9ec23117..c68e5e8a 100644 --- a/ext/bg/js/dictionary.js +++ b/ext/bg/js/dictionary.js @@ -35,12 +35,16 @@ class Dictionary { let results = []; for (let name in this.termDicts) { - const dict = this.termDicts[name]; - const indices = dict.indices[term] || []; + const dict = this.termDicts[name]; + const indexStr = dict.i[term] || null; + if (indexStr === null) { + continue; + } + const indices = indexStr.split(' ').map(Number); results = results.concat( indices.map(index => { - const [e, r, t, ...g] = dict.defs[index]; + const [e, r, t, ...g] = dict.d[index]; const addons = []; const tags = t.split(' '); -- cgit v1.2.3