1

Changling location of deinflect and dictionary data files

Former-commit-id: 9e5ec9facd8ab2c77115689c8b7261b8c5ce41ac
This commit is contained in:
Alex Yatskov 2013-11-10 08:27:40 -08:00
parent 0f530cd3c8
commit 88a3b2e3a0
5 changed files with 4 additions and 8 deletions

View File

@ -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

View File

@ -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'))
)