summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-03 21:09:21 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-03 21:09:21 -0700
commit02d679a461459499e038d5fedbeec2baebf31f31 (patch)
tree09839fa955f058a8c1edb49b11aedf5a1493fe7d /ext/bg
parent43e20245294bed250ba949be414a1dff3d8d45fb (diff)
Updating enamdict and edict, code to load dictionaries.
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/dictionary.js10
1 files changed, 7 insertions, 3 deletions
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(' ');