From 88a3b2e3a01d1c25c202a222006cf7e1a9da5b9c Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 10 Nov 2013 08:27:40 -0800 Subject: [PATCH] Changling location of deinflect and dictionary data files Former-commit-id: 9e5ec9facd8ab2c77115689c8b7261b8c5ce41ac --- build_dict.sh | 2 +- yomi_base/japanese/{data => }/.gitattributes | 0 yomi_base/japanese/__init__.py | 10 +++------- yomi_base/japanese/{data => }/deinflect.json | 0 yomi_base/japanese/{data => }/dictionary.db | 0 5 files changed, 4 insertions(+), 8 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 f24b19c..0c668e2 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/data/dictionary.db +DICT=yomi_base/japanese/dictionary.db rm $DICT util/compile.py --kanjidic $KANJIDIC --kradfile $KRADFILE --edict $EDICT $DICT diff --git a/yomi_base/japanese/data/.gitattributes b/yomi_base/japanese/.gitattributes similarity index 100% rename from yomi_base/japanese/data/.gitattributes rename to yomi_base/japanese/.gitattributes diff --git a/yomi_base/japanese/__init__.py b/yomi_base/japanese/__init__.py index cd8a6b4..25f19ee 100644 --- a/yomi_base/japanese/__init__.py +++ b/yomi_base/japanese/__init__.py @@ -22,13 +22,9 @@ import os.path import translate -def buildRelPath(path): - directory = os.path.split(__file__)[0] - return os.path.join(directory, path) - - def initLanguage(): + directory = os.path.split(__file__)[0] return translate.Translator( - deinflect.Deinflector(buildRelPath('data/deinflect.json')), - dictionary.Dictionary(buildRelPath('data/dictionary.db')) + deinflect.Deinflector(os.path.join(directory, 'deinflect.json')), + dictionary.Dictionary(os.path.join(directory, 'dictionary.db')) ) diff --git a/yomi_base/japanese/data/deinflect.json b/yomi_base/japanese/deinflect.json similarity index 100% rename from yomi_base/japanese/data/deinflect.json rename to yomi_base/japanese/deinflect.json diff --git a/yomi_base/japanese/data/dictionary.db b/yomi_base/japanese/dictionary.db similarity index 100% rename from yomi_base/japanese/data/dictionary.db rename to yomi_base/japanese/dictionary.db