diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-03-26 14:16:21 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-03-26 14:16:21 -0700 |
commit | 12696d3e6b3d7f1b92923ed625fdb3dc5ec660f2 (patch) | |
tree | 2d05fec92742a0b2d737d085cac7e9beb3c3f579 /ext/jp/translator.js | |
parent | d38c5390eeb85438ee00fd528212dce4b31b457e (diff) |
Reorg
Diffstat (limited to 'ext/jp/translator.js')
-rw-r--r-- | ext/jp/translator.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/jp/translator.js b/ext/jp/translator.js index aef20f19..7a610377 100644 --- a/ext/jp/translator.js +++ b/ext/jp/translator.js @@ -18,9 +18,17 @@ class Translator { - constructor(paths, callback) { + constructor() { this.dictionary = new Dictionary(); this.deinflector = new Deinflector(); + this.initialized = false; + } + + loadData(paths, callback) { + if (this.initialized) { + callback(); + return; + } const loaders = []; for (const key of ['rules', 'edict', 'enamdict', 'kanjidic']) { |