Python implementation of kakasi - kana kanji simple inversion library
Project description
Overview
pykakasi is re-implementation of kakasi library (original is written in C) in Python.
How To Use pykakasi
Build and install from source(recommended):
pip install git+https://github.com/miurahr/pykakasi
Building library, setup script build dictionary db file and generate pickled db files. Without dictionary files, a library fails to run.
Sample source code:
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("s", True) # add space default: no Separator
kakasi.setMode("C", True) # capitalize default: no Capitalize
conv = kakasi.getConverter()
result = conv.do(text)
wakati = wakati()
conv = kawati.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 storing 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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pykakasi-0.25.tar.gz.
File metadata
- Download URL: pykakasi-0.25.tar.gz
- Upload date:
- Size: 2.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0380beac7869ccbc7e822e11fb0c968cfc8616d768e33032ef8e0e5e66b285b
|
|
| MD5 |
9b6959d1895469e4260a822af6b3bb73
|
|
| BLAKE2b-256 |
a641e0cdfa7ba29decb9a1ac78d4b0f5b09ebac7a2bacba929326f90070f71b5
|
File details
Details for the file pykakasi-0.25-py3-none-any.whl.
File metadata
- Download URL: pykakasi-0.25-py3-none-any.whl
- Upload date:
- Size: 3.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcff4cd9f7b7351cda14137206ec22c8e953861cd3eb6136ed1c8d5dc7898b27
|
|
| MD5 |
648523b3507b3541903d926c1753f0a5
|
|
| BLAKE2b-256 |
640f195ecf6d036e6c2ce5e2a161eeaf34ed97db4fb271afa55203f1bcd56343
|
File details
Details for the file pykakasi-0.25-py2-none-any.whl.
File metadata
- Download URL: pykakasi-0.25-py2-none-any.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4f923debf6b8a53ad396d488be9afe767feb1f143cb50bbb644e0313816412a
|
|
| MD5 |
d5623320697045c12aa8cbc5b9a2bf5e
|
|
| BLAKE2b-256 |
a063eb7e9d7dc5f74fda9c152ab1de62b47ff64b52b248d68efa7a23c5072db1
|