1
yomichan-anki/yomi_base/japanese/__init__.py
Alex Yatskov 0f530cd3c8 Revert "Moving location of deinflect and dictionary data"
This reverts commit e7636cd4f5 [formerly 148b64a53c3c62daf60c2c959f0140b1a39bb08b].


Former-commit-id: 7e8125b59820a6f3e38d31865e3f9bf063e67835
2013-11-10 04:28:09 -08:00

35 lines
1.0 KiB
Python

# -*- coding: utf-8 -*-
# Copyright (C) 2013 Alex Yatskov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import deinflect
import dictionary
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(buildRelPath('data/deinflect.json')),
dictionary.Dictionary(buildRelPath('data/dictionary.db'))
)