jamorasep.kana_util

Module Contents

Functions

h2k([text])

Convert hiragana to katakana.

k2h([text])

Convert katakana to hiragana.

is_hiragana([text])

Check if the input is hiragana.

is_katakana([text])

Check if the input is katakana.

is_kana([text])

Check if the input is hiragana or katakana.

jamorasep.kana_util.h2k(text: str = '')

Convert hiragana to katakana. Characters other than hiragana are not converted. Only Unicode is supported, which is the default code in Python3.

Parameters:

text (str) – hiragana string

Returns:

katakana string

Return type:

str

jamorasep.kana_util.k2h(text: str = '')

Convert katakana to hiragana. Characters other than katakana are not converted. Only Unicode is supported, which is the default code in Python3. Hankaku katakana will not be converted. Some special katakana such as ヸ will not be converted, too.

Parameters:

text (str) – katakana string

Returns:

hiragana string

Return type:

str

jamorasep.kana_util.is_hiragana(text: str | List[str] = '')

Check if the input is hiragana. Only Unicode is supported, which is the default code in Python3.

Parameters:

text (str) – string

Returns:

True if the input is hiragana.

Return type:

bool

jamorasep.kana_util.is_katakana(text: str | List[str] = '')

Check if the input is katakana. Only Unicode is supported, which is the default code in Python3.

Parameters:

text (str) – string

Returns:

True if the input is katakana.

Return type:

bool

jamorasep.kana_util.is_kana(text: str | List[str] = '')

Check if the input is hiragana or katakana. Only Unicode is supported, which is the default code in Python3.

Parameters:

text (str) – string

Returns:

True if the input is hiragana or katakana.

Return type:

bool