Open yudataguy opened 6 years ago
I have got the same error message.
I believe this module is for Python 2 only. Python 3 is not supported.
You can make this work in python3 without to much change. In the __init__.py of the main folder and the models module folder add a . in front of each of the imports
For the models __init__.py
from .UnicodeRomajiMapping import UnicodeRomajiMapping
from .KanjiBlock import KanjiBlock
from .Particle import Particle
While for the main __init__.py
from .kanji_to_romaji_module import convert_hiragana_to_katakana, translate_to_romaji, translate_soukon, \
translate_long_vowel, translate_soukon_ch, kanji_to_romaji
When this is done you will still get some errors due to minor differences in how python2 and 3 works. To get this working you need to make some changes in the kanji_to_romaji_module.py
open(os.path.join(JP_MAPPINGS_PATH, f),encoding='utf-8')
For some reason the open function defaults to cp1252 encoding and i got some UnicodeDecodeError if i didn't do this.With these steps taken, i got it to work in python 3.
I would make a fork or commit, but i am new to git and python development, so not sure how to proceed.
cheers.
@lorithai thank you for your contribution. I made a PR implementing the changes that you outlined.
Hello,
Any progress on the PR from @onnudilol ? I tested it and works fine for me. I would be really great to have it integrated and generate a pip package from it.
thanks in advance.
What's the likely cause of this error?