aboutsummaryrefslogtreecommitdiff
path: root/ext/jp/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-03-26 14:16:21 -0700
committerAlex Yatskov <alex@foosoft.net>2016-03-26 14:16:21 -0700
commit12696d3e6b3d7f1b92923ed625fdb3dc5ec660f2 (patch)
tree2d05fec92742a0b2d737d085cac7e9beb3c3f579 /ext/jp/translator.js
parentd38c5390eeb85438ee00fd528212dce4b31b457e (diff)
Reorg
Diffstat (limited to 'ext/jp/translator.js')
-rw-r--r--ext/jp/translator.js10
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']) {