Pure-Python port of eyo-kernel (dictionary-based yoification)
Project description
peyo
Pure-Python port of eyo-kernel (dictionary-based Russian “ё” restoration / yoification).
No Node.js required.
🇷🇺 Русская документация: README.ru.md
Install
pip install peyo
Quickstart
import peyo
text = "«Лед тронулся, господа присяжные заседатели!»"
print(peyo.yoify(text))
# -> «Лёд тронулся, господа присяжные заседатели!»
Modes
Yoification in Russian is ambiguous (e.g. все/всё, осел/осёл).
So peyo supports two modes:
mode="safe"(default): conservative replacements, minimal false positivesmode="not_safe": more aggressive, can produce mistakes
import peyo
print(peyo.yoify("Ежик и елка"))
# -> "Ёжик и ёлка"
print(peyo.yoify("все", mode="safe"))
# -> "все" (safe avoids ambiguous cases)
print(peyo.yoify("все", mode="not_safe"))
# -> "всё" (more aggressive)
API
peyo.yoify(text: str, mode: str = "safe") -> str
Main function. Stable public API.
Aliases:
peyo.restore(...)peyo.yo(...)
peyo.lint(text: str, mode: str = "safe", group_by_words: bool = False) -> list[dict]
Returns a list of suggested replacements (does not modify the text).
Example output item:
{
"before": "Лед",
"after": "Лёд",
"position": [{"line": 1, "column": 2, "index": 1}]
}
Notes
- This library is dictionary-based (no ML, no true contextual disambiguation).
safemode is recommended for fully automatic pipelines.- For maximum quality you typically use
saferestore + manual review ofnot_safecandidates.
Attribution / License
This project is a Python port of eyo-kernel by Denis Seleznev and uses upstream dictionaries.
The upstream project is MIT-licensed. See LICENSE.
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 Distribution
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 peyo-0.2.0.tar.gz.
File metadata
- Download URL: peyo-0.2.0.tar.gz
- Upload date:
- Size: 108.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
029cdd3bc037fa65dd76d355264799a2789def5cde71193d733d4cebad34fcc7
|
|
| MD5 |
ed07f06849310c3f62a8dbaa890f1f4a
|
|
| BLAKE2b-256 |
bb7806b89838a1dd4e6caa9f367594b0bc9e0f1697255762a5d2a1e31364fcbb
|
File details
Details for the file peyo-0.2.0-py3-none-any.whl.
File metadata
- Download URL: peyo-0.2.0-py3-none-any.whl
- Upload date:
- Size: 108.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
851a1cd75263756e0fea790311d128b16f5197e7f7cb76107bdd899689f87fea
|
|
| MD5 |
b4853e6c051d9a9513d9ac434ac1afdb
|
|
| BLAKE2b-256 |
e88d58ba24e2efc9d5a39a30463934ff2b33ee43433fcd4e142407dd229f9eef
|