Giter Site home page Giter Site logo

pykakasi's Introduction

Pykakasi library

Join the chat at https://gitter.im/miurahr/pykakasi

travis-ci PyPI version Coverage Status

pykakasi is re-imprelemtation of kakasi library by Python.

How To Use pykakasi

    from pykakasi import kakasi,wakati

    kakasi = kakasi()
    kakasi.setMode("H","a") # default: Hiragana no conversion
    kakasi.setMode("K","a") # default: Katakana no conversion
    kakasi.setMode("J","a") # default: Japanese no conversion
    kakasi.setMode("r","Hepburn") # default: use Hepburn Roman table
    kakasi.setMode("C", True) # add space default: no Separator
    kakasi.setMode("c", False) # capitalize default: no Capitalize
    conv = kakasi.getConverter()
    result = conv.do(text)

    wakati = wakati()
    conv = wakati.getConverter()
    result = conv.do(text)

You can use output Mode values from "h", "k", "a" which is each means "Hiragana", "Katakana" and "Alphabet". For input, you can use "J" that means "Japanese" that is mixture of Kanji, Katakana and Hiragana. Also there is values of "H", "K" that means "Hiragana", and "Katakana". You can use "Hepburn", "Kunrei" or "Passport" as mode "r", Roman table switch. Also "s" used for separator switch, "C" for capitalize switch. "S" for separator string option.

wakati is an implementation of kakasi's wakati gaki option.

Options

These switch alphabets are derived from original Kakasi. Now it support following options:

Option Description Values Note
K Katakana convertion a,H,None roman or noconversion
H Hiragana convertion a,K,None roman or noconversion
J Kanji conversion a,H,K,None roman or Hiragana, Katakana
E Eigou convesion a,None roman or noconversion

Each character means character sets as follows:

  Character Sets:
       a: ascii  j: jisroman  g: graphic  k: kana 
       (j,k     defined in jisx0201)
       E: kigou  K: katakana  H: hiragana J: kanji
       (E,K,H,J defined in jisx0208)

pykakasi's People

Contributors

miurahr avatar fgtatsuro avatar gitter-badger avatar manabu avatar

Watchers

salexkidd avatar James Cloos avatar

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.