Updating enamdict and edict, code to load dictionaries.

This commit is contained in:
Alex Yatskov 2016-08-03 21:09:21 -07:00
parent 43e2024529
commit 02d679a461

View File

@ -36,11 +36,15 @@ class Dictionary {
for (let name in this.termDicts) {
const dict = this.termDicts[name];
const indices = dict.indices[term] || [];
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(' ');