Language

class chepy.modules.language.Language(*data)
decode(encoding: str, errors: str = 'backslashreplace') LanguageT

Decode the string using the given encoding.

Parameters
  • encoding (str) – Encoding to use.

  • errors (str, optional) – How to handle errors when decoding. Defaults to ‘backslashreplace’.

Returns

The Chepy object.

Return type

Chepy

encode(encoding: str, errors: str = 'backslashreplace') LanguageT

Encode the string using the given encoding.

Parameters
  • encoding (str) – Encoding to use.

  • errors (str, optional) – How to handle errors when encoding. Defaults to ‘backslashreplace’.

Returns

The Chepy object.

Return type

Chepy

encode_us_ascii_7_bit() LanguageT

Encode state using US ascii 7 bit

Returns

The Chepy object.

Return type

Chepy

find_emojis() LanguageT

Find emojis, symbols, pictographs, map symbols and flags

Returns

The Chepy object.

Return type

Chepy

remove_diacritics() LanguageT

Replaces accented characters latin character equivalent.

Returns

The Chepy object.

Return type

Chepy

search_perl_unicode_props(lang: str) LanguageT

Search using perl unicode properties. https://perldoc.perl.org/perluniprops#(%5Cd+)-in-the-info-column-gives-the-number-of-Unicode-code-points-matched-by-this-property.

Parameters

lang (str) – Required. A string value identifying the language.

Returns

The Chepy object.

Return type

Chepy

str_to_unicode(prefix: str = '\\u', all_chars: bool = False) LanguageT

Convert unicode to str

Parameters
  • prefix (str) – Prefix character.

  • all_chars (bool) – Force convert all chars to unicode.

Returns

The Chepy object.

Return type

Chepy

unicode_to_str(as_bytes=False) LanguageT

Escape any u characters to its proper unicode representation

Parameters

as_bytes (bool) – Treat state as bytes. This does not handle %u or U+ encodings

Returns

The Chepy object.

Return type

Chepy