ainconv.detection module#

class ainconv.detection.Script(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

An enumeration of the possible script types for the Ainu language.

Cyrl = 'Cyrl'#

The Latin script.

Kana = 'Kana'#

The Cyrillic script.

Latn = 'Latn'#

A mixed script.

Mixed = 'Mixed'#

An unknown script.

Unknown = 'Unknown'#
ainconv.detection.detect(text: str) Script#

Detects the script type of a given Ainu language string.

This function categorizes the script into one of several types based on the characters present in the string.

It supports Latin, Cyrillic, Katakana scripts, and can also identify mixed or unknown scripts.

Parameters:

text (str) – The text string to be analyzed for script type.

Returns:

The detected script type:

Kana for Katakana Cyrl for Cyrillic Latn for Latin Mixed if multiple scripts are detected Unknown if no script is detected

Return type:

Script

ainconv.detection.is_cyrillic(char: str) bool#
ainconv.detection.is_katakana(char: str) bool#