Skip to content

itsupera/furigana

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 4 commits ahead of SteveClement:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

furigana

Generate furigana(振り仮名) from Japanese

It uses MeCab (a Natural Language Toolkit) to split Japanese into words, and superscript it with furigana (振り仮名).

Example:

input

from furigana.furigana import print_html
print_html('澱んだ街角で僕らは出会った')

output

よど ん だ 街角まちかどぼく ら は っ た

input

from furigana.furigana import print_html
print_html('お茶にお煎餅、よく合いますね')

output

ちゃ に お 煎餅せんべい 、 よく い ます ね

Usage

$ python3 furigana/furigana.py '活版印刷の流れを汲む出版作業では'

Dependency

See https://pypi.python.org/pypi/mecab-python3/0.7
run below commands on ubuntu

sudo apt-get install libmecab-dev mecab mecab-ipadic-utf8
sudo -H pip3 install .

Conflict with Anaconda Python

Please use Ubuntu's original python3, not to use with Anaconda Python3

Testing

Some unit tests are provided:

sudo -H pip3 install pytest
python3 -m pytest -s tests/test_furigana.py

About

Generate furigana from Japanese

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%