diff --git a/build_dict.sh b/build_dict.sh index 0c668e2..f24b19c 100755 --- a/build_dict.sh +++ b/build_dict.sh @@ -3,7 +3,7 @@ KANJIDIC=util/data/kanjidic KRADFILE=util/data/kradfile EDICT=util/data/edict -DICT=yomi_base/japanese/dictionary.db +DICT=yomi_base/japanese/data/dictionary.db rm $DICT util/compile.py --kanjidic $KANJIDIC --kradfile $KRADFILE --edict $EDICT $DICT diff --git a/yomi_base/japanese/__init__.py b/yomi_base/japanese/__init__.py index 30edf38..cd8a6b4 100644 --- a/yomi_base/japanese/__init__.py +++ b/yomi_base/japanese/__init__.py @@ -22,8 +22,13 @@ import os.path import translate +def buildRelPath(path): + directory = os.path.split(__file__)[0] + return os.path.join(directory, path) + + def initLanguage(): return translate.Translator( - deinflect.Deinflector('data/deinflect.json'), - dictionary.Dictionary('data/dictionary.db') + deinflect.Deinflector(buildRelPath('data/deinflect.json')), + dictionary.Dictionary(buildRelPath('data/dictionary.db')) ) diff --git a/yomi_base/japanese/.gitattributes b/yomi_base/japanese/data/.gitattributes similarity index 100% rename from yomi_base/japanese/.gitattributes rename to yomi_base/japanese/data/.gitattributes diff --git a/yomi_base/japanese/deinflect.json b/yomi_base/japanese/data/deinflect.json similarity index 100% rename from yomi_base/japanese/deinflect.json rename to yomi_base/japanese/data/deinflect.json diff --git a/yomi_base/japanese/dictionary.db b/yomi_base/japanese/data/dictionary.db similarity index 100% rename from yomi_base/japanese/dictionary.db rename to yomi_base/japanese/data/dictionary.db