PyKatsuyou
A Japanese verb/adjective inflections tool for python.
PyKatsuyou uses these great packages:
- igo-python (detecting verbs and adjectives)
- jaconv (convert katakana --> hiragana)
- tabulate (print a table)
Install
pip install pykatsuyou
Usage
This tool requires that you input the dictionary form of the verb/adjective. Using only hiragana may have strange results (unless it's an irregular verb).
from tabulate import tabulate
from pykatsuyou import getInflections
from igo.tagger import Tagger
tt = Tagger() # Optional
data = getInflections('する', jsonIndent=2, tt=tt)
print(data['json'])
print(data['list'])
table = getInflections('行く', dataframe=True)
print(tabulate(table, headers='keys', tablefmt='pretty'))
CLI
pykatsuyou する
pykatsuyou -h
Usage:
pykatsuyou [verb/adjective] [-h/-j/-l]
*Must use dictionary form
Options:
***A table is printed by default***
-h (--help) = outputs this text
-j (--json) = prints json
-l (--list) = prints a list
Output - 行く
Object
{
# json contains a json string
'json': '{
"Affirmative": {
"Dict-Form": "行く",
"Non-Past Polite": "行きます",
"Past": "行った",
"Past Polite": "行きました",
"Te-Form": "行って",
"Imperative": "行け",
"Conditional": "行けば",
"Volitional": "行こう"
},
"Negative": {
"Dict-Form": "行かない",
"Non-Past Polite": "行きません",
"Past": "行かなかった",
"Past Polite": "行きませんでした",
"Te-Form": "行かなくて",
"Imperative": "行くな",
"Conditional": "行かなければ",
"Volitional": "x"
}
}',
'list': [
'行きます',
'行った',
'行きました',
'行って',
'行け',
'行けば',
'行こう',
'行きません',
'行かなかった',
'行きませんでした',
'行かなくて',
'行くな',
'行かなければ'
]
}
Table
| Godan Verb | Affirmative | Negative |
|---|---|---|
| Dict-Form | 行く | 行かない |
| Non-Past Polite | 行きます | 行きません |
| Past | 行った | 行かなかった |
| Past Polite | 行きました | 行きませんでした |
| Te-Form | 行って | 行かなくて |
| Imperative | 行け | 行くな |
| Conditional | 行けば | 行かなければ |
| Volitional | 行こう | x |
Metadata
Release files for PyKatsuyou 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| PyKatsuyou-1.1.1.tar.gz | 8.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PyKatsuyou-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / PyKatsuyou-1.1.1.tar.gz
| Download URL | PyKatsuyou-1.1.1.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9bc132037bb80e27fa5cc75a64066b8369a6bba8080f5077c68fc2d0077f562
|
|
BLAKE2b-256 checksum How to use checksums |
913c45ab2618feca7b194d1689d25c70efe97690662a9cc9dc46dc7cc613493f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / PyKatsuyou-1.1.1-py3-none-any.whl
| Download URL | PyKatsuyou-1.1.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2452b9f728f6918d4e7cd1f36d75ceedbf45ec11c17901cde34ff76b95990efd
|
|
BLAKE2b-256 checksum How to use checksums |
181a42d05b1e1ac44f8290f6b19344fa6f191b1e4d86131a08137023744fe8cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|