Code Monkey home page Code Monkey logo

furigana's Introduction

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

furigana's People

Contributors

itsupera avatar mikimotoh avatar mymro avatar steveclement avatar yuriko-aya avatar

Forkers

junshengpierre

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.