aboutsummaryrefslogtreecommitdiff
path: root/ext/jp/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-03-20 17:15:40 -0700
committerAlex Yatskov <alex@foosoft.net>2016-03-20 17:15:40 -0700
commitd8a630fa2881a0cf012c6548706dde7c4740fe14 (patch)
tree80a4cc60c491373154d5c39146b3c0dac9eb3840 /ext/jp/translator.js
parent7208872b9fee135318b8a1a8b4483547b3986c89 (diff)
Simple lookup now works.
Diffstat (limited to 'ext/jp/translator.js')
-rw-r--r--ext/jp/translator.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/ext/jp/translator.js b/ext/jp/translator.js
index be15c397..79f2b369 100644
--- a/ext/jp/translator.js
+++ b/ext/jp/translator.js
@@ -18,10 +18,7 @@
class Translator {
constructor() {
- this.rules = {};
- this.edict = {};
- this.enamdict = {};
- this.kanjidic = {};
+ this.dictionary = new Dictionary();
this.initialized = false;
}
@@ -38,10 +35,9 @@ class Translator {
}
$.when.apply($, loaders).done((rules, edict, enamdict, kanjidic) => {
- this.rules = rules;
- this.edict = edict;
- this.enamdict = enamdict;
- this.kanjidic = kanjidic;
+ this.dictionary.addTermDict(edict[0]);
+ this.dictionary.addTermDict(enamdict[0]);
+ this.dictionary.addKanjiDict(kanjidic[0]);
this.initialized = true;
@@ -60,5 +56,6 @@ trans.initialize({
enamdict: 'jp/data/enamdict.json',
kanjidic: 'jp/data/kanjidic.json',
}, function() {
- alert('Loaded');
+ // alert('Loaded');
+ // alert(trans.dictionary.findTerm('猫'));
});