Skip to main content

Python implementation of kakasi - kana kanji simple inversion library

Project description

Pykakasi library
==================

[![travis-ci](https://secure.travis-ci.org/miurahr/pykakasi.png)](https://secure.travis-ci.org/miurahr/pykakasi)
[![Downloads](https://pypip.in/d/Pykakasi/badge.png)](https://crate.io/packages/Pykakasi)
[![PyPI version](https://badge.fury.io/py/pykakasi.png)](http://badge.fury.io/py/Pykakasi)

pykakasi is re-imprelemtation of kakasi library by Python.

How To Use pykakasi
------------------

```python
import pykakasi.kakasi as kakasi

kakasi = kakasi()
kakasi.setMode("H","a") # default: Hiragana -> Roman
kakasi.setMode("K","a") # default: Katakana -> Roman
kakasi.setMode("J","a") # default: Japanese -> Roman
kakasi.setMode("r","Hepburn") # default: use Hepburn Roman table
kakasi.setMode("C", true) # default: Separator
kakasi.setMode("c", false) # default: no Capitalize
conv = kakasi.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" or "Kunrei" as mode "r", Roman table switch.
Also "C" used for separator switch, "c" for capitalize switch.


Options
-------------------

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

| option | description | possible values | note |
| ------ | :---------- | --------------- | :---------- |
| "K" | Katakana convertion | "a" or None | roman or noconversion |
| "H" | Hiragana convertion | "a" or None | roman or noconversion |
| "J" | Kanji conversion | "a", "h", "k", or None | roman or Hiragana, Katakana |

Original kakasi defines following options:

```
-a[jE] -j[aE] -g[ajE] -k[ajKH]
-E[aj] -K[ajkH] -H[ajkK] -J[ajkKH]
-i{oldjis,newjis,dec,euc,sjis}
-o{oldjis,newjis,dec,euc,sjis}
-r{hepburn,kunrei} -p -s -f -c"chars"
[jisyo1, jisyo2,,,]

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)

Options:
-i: input coding system -o: output coding system
-r: romaji conversion system
-p: list all readings (with -J option)
-s: insert separate characters (with -J option)
-f: furigana mode (with -J option)
-c: skip chars within jukugo
(with -J option: default TAB CR LF BLANK)
-C: romaji Capitalize (with -Ja or -Jj option)
-U: romaji Upcase (with -Ja or -Jj option)
-u: call fflush() after 1 character output
-w: wakatigaki mode
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykakasi-0.01.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pykakasi-0.01-py2.7.egg (2.5 MB view details)

Uploaded Egg

File details

Details for the file pykakasi-0.01.tar.gz.

File metadata

  • Download URL: pykakasi-0.01.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pykakasi-0.01.tar.gz
Algorithm Hash digest
SHA256 e34403abce478cfbd5019f186e49ccd79f2ac966bdf9df86a3bed56929272e13
MD5 753977486b35f4ce2b13792239217ebc
BLAKE2b-256 da62c019927afc796db2c180b769d69fb216c14cdde5c63e373b6420a7b3bf15

See more details on using hashes here.

File details

Details for the file pykakasi-0.01-py2.7.egg.

File metadata

  • Download URL: pykakasi-0.01-py2.7.egg
  • Upload date:
  • Size: 2.5 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pykakasi-0.01-py2.7.egg
Algorithm Hash digest
SHA256 04fa7ad25adc04502612ef20f1c52854cacea65cf4387cb31573e35f882e663f
MD5 e24297c84f6825832a918eb64b75a017
BLAKE2b-256 f8272dea98a6215c48d2b221db12125fb5c4cfa5fc9cf2c5ababecd2ca9431c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page