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

@ -35,12 +35,16 @@ class Dictionary {
let results = []; let results = [];
for (let name in this.termDicts) { for (let name in this.termDicts) {
const dict = this.termDicts[name]; 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( results = results.concat(
indices.map(index => { indices.map(index => {
const [e, r, t, ...g] = dict.defs[index]; const [e, r, t, ...g] = dict.d[index];
const addons = []; const addons = [];
const tags = t.split(' '); const tags = t.split(' ');