From 0f530cd3c8623ca7571511c557ac19218b627144 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 10 Nov 2013 04:28:09 -0800 Subject: [PATCH] Revert "Moving location of deinflect and dictionary data" This reverts commit e7636cd4f54a526cdd027498acab689980559c9f [formerly 148b64a53c3c62daf60c2c959f0140b1a39bb08b]. Former-commit-id: 7e8125b59820a6f3e38d31865e3f9bf063e67835 --- build_dict.sh | 2 +- yomi_base/japanese/__init__.py | 9 +++++++-- yomi_base/japanese/{ => data}/.gitattributes | 0 yomi_base/japanese/{ => data}/deinflect.json | 0 yomi_base/japanese/{ => data}/dictionary.db | 0 5 files changed, 8 insertions(+), 3 deletions(-) rename yomi_base/japanese/{ => data}/.gitattributes (100%) rename yomi_base/japanese/{ => data}/deinflect.json (100%) rename yomi_base/japanese/{ => data}/dictionary.db (100%) 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