dnc1994 / Furigana

Help you add furigana to your Japanese notes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Furigana

Help you add furigana to your Japanese notes.

Usage

Write your notes like this:

[今度]{こんど}こそ[君]{きみ}だけは[幸]{しあわ}せにしてみせる

Run the script:

python furigana.py [note1.md note2.md ...]

You get:

<ruby>今度<rp>(</rp><rt>こんど</rt><rp>)</rp></ruby>こそ<ruby>君<rp>(</rp><rt>きみ</rt><rp>)</rp></ruby>だけは<ruby>幸<rp>(</rp><rt>しあわ</rt><rp>)</rp></ruby>せにしてみせる

Which renders to:

今度こんどこそきみだけはしあわせにしてみせる

The original file would be saved in a .bak before the conversion.

Note

  1. For the the <ruby> tag to render properly, the browser must support it. See HTML Tag.
  2. Currently, in order to precisely map furigana to kanji, you'll have to split kanji into individual ones manually. I'm trying to develop some matching algorithms here but the subtlety of kanji makes it terribly complicated to do so. Help me if you think you know how to do it smartly.

Author

Linghao Zhang

License

MIT license

About

Help you add furigana to your Japanese notes.


Languages

Language:Python 100.0%