Funny Word Generator
Генератор смешных и нелепых слов для Python на основе фонетических паттернов. Пакет подбирает забавные сочетания звуков, прикрепляет к ним нелепые суффиксы и использует систему баллов (funniness score), чтобы возвращать только самые «острые» и дурацкие варианты.
Особенности
- Алгоритм скоринга: Слова получают баллы за редкие гласные («ы», «э»), твердые и шипящие согласные («ш», «ч», «к», «п»), и нелепые суффиксы («-ып», «-ун»).
- Анализ паттернов: Слова строятся по шаблонам для получения тягучего или абсурдного звучания (например, CVC + суффикс).
- CLI-интерфейс: Возможность генерации напрямую из консоли.
- Чистый код: Пакет строго типизирован, соответствует современным стандартам (Python 3.10+) и легко расширяем.
Установка
Поскольку пакет использует pyproject.toml, вы можете установить его стандартными средствами pip:
pip install .
Или для установки вместе с инструментами разработки (тесты, линтеры):
pip install ".[dev]"
Использование из кода
Вы можете импортировать WordGenerator в ваши Python скрипты. Класс позволяет настраивать порог "забавности" — чем он выше, тем жестче отбор сгенерированных кандидатов.
from funny_word_generator import WordGenerator
# Создаем генератор с минимальным порогом оценки (F-score = 3)
generator = WordGenerator(threshold=3)
# Генерируем 5 слов
words = generator.generate(count=5)
print(words)
# Пример вывода: ['Шокып', 'Чумтыр', 'Грожик', 'Жочун', 'Хыпюр']
Использование через CLI
После установки пакета в вашем терминале будет доступна утилита funny-words.
$ funny-words --count 5 --threshold 4
Сгенерировано 5 забавных слов (Порог: 4):
----------------------------------------
Шокып
Чумпыр
Кхурюн
Жучуп
Пачаш
Список аргументов:
-c,--count: Количество слов для генерации (по умолчанию 5).-t,--threshold: Минимальный балл забавности слова.
Разработка и тестирование
Для запуска тестов мы используем pytest. Убедитесь, что вы установили dev-зависимости.
# Запуск тестов
pytest
# Запуск проверки типов
mypy .
# Запуск линтера
ruff check .
Принцип работы алгоритма
- Создание базы: Исходно берутся массивы твердых согласных и редких гласных.
- Паттерны: Накладывается шаблон сборки слогов.
- Скоринг (Оценка F):
- +балл за наличие необычных гласных после шипящих.
- +бонус за использование специальных «детских» окончаний (-ик, -ып, -юр).
- Отрицательные баллы за банальность или попадание в стоп-лист.
- Фильтрация: Кандидаты, набравшие баллы ниже порогового значения (threshold), отбрасываются. Выдается список из самых успешных мутаций.
Metadata
Release files for funny-word-generator 0.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 | Provenance | Actions |
|---|---|---|---|---|
| funny_word_generator-0.1.1.tar.gz | 6.8 kB | With provenance | Details for funny_word_generator-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| funny_word_generator-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for funny_word_generator-0.1.1-py3-none-any.whl |
Total release size: 14.6 kB
Release files / funny_word_generator-0.1.1.tar.gz
| Download URL | funny_word_generator-0.1.1.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e89bf8bdea893620fa368abdc7e2f544f7ce8bb726c4db56e0a7931a890aa0f
|
|
BLAKE2b-256 checksum How to use checksums |
fc92b4aff23277ac649c742c61fff4e558ef63b93540eaa7525353f0a85d947e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 17, 2026.
Transparency logRelease files / funny_word_generator-0.1.1-py3-none-any.whl
| Download URL | funny_word_generator-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76e86f49ffbbf802280317c8b1dcddffdf0d65b4b5e99a9ab801477c951a109c
|
|
BLAKE2b-256 checksum How to use checksums |
7db83cd44f80970b87cdb5712987b7b530f29afcf22585c7c75c684da6357d0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 17, 2026.
Transparency logSecurity for funny-word-generator 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for funny_word_generator-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.