Adding furigana on blogger

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

Global Game Jam 2024

Wow, what a weekend. The Global Game Jam is intense. But I and 3 other members manage to build a game for the theme "Make me laugh&quo...