summaryrefslogtreecommitdiff
path: root/ext/bg/js/dictionary.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-24 18:59:29 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-24 18:59:29 -0700
commitcac6fc1427106420b28777d94907bf27ab1995a3 (patch)
treee8ab59bed16d7e2ba1ed887ffb2b9ccee510f9a9 /ext/bg/js/dictionary.js
parenta192a8d8b549d5979a427d86c51f94bb5f4be907 (diff)
Basic kanji output
Diffstat (limited to 'ext/bg/js/dictionary.js')
-rw-r--r--ext/bg/js/dictionary.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js
index 90a40ee5..cc7b507c 100644
--- a/ext/bg/js/dictionary.js
+++ b/ext/bg/js/dictionary.js
@@ -74,11 +74,16 @@ class Dictionary {
findKanji(kanji) {
const results = [];
- for (const name in this.termDicts) {
- const def = this.termDicts[name][kanji];
+ for (const name in this.kanjiDicts) {
+ const def = this.kanjiDicts[name][kanji];
if (def) {
- const [c, k, o, g] = def;
- results.push({id: index, character: c, kunyomi: k, onyomi: o, glossary: g});
+ const [k, o, g] = def;
+ results.push({
+ character: kanji,
+ kunyomi: k.split(' '),
+ onyomi: o.split(' '),
+ glossary: g
+ });
}
}