To do my translations, I use the online Furiganizer to write down the furigana. Then I copy the text to a generic text editor, which gives me each word on each line. This online tool does not give the correct placements of the furigana, and sometimes returns this:
Wrong furigana: おま
Kanji: お待ち (supposed to be only the kanji)
Nor kanji or furigana: しています
So, I need to manually check if the line contains only the kanji, like this:
Correct furigana: ま
Kanji: 待
Nor kanji or furigana: ちしています
After, that, I use the regex (regular expression) package for Python 3 to identify the kanjis and the hiraganas representing the furiganas, to write a file like this:
お{待}^{ま}ちしています
Finally, I read this new markers to substitute it by the HTML code that will write the furigana for blogspot.
お<ruby>待<rt>ま</rt></ruby>ちしています
The code is available here.
In the future, I can make a better furiganizer.
No comments:
Post a Comment