замена слов и фраз по словарям замен с сохранением исходного регистра
Project description
pip install prlps_text_replacer
from prlps_text_replacer import text_replace_by_dict
text = "Гуманоидный робот и Соединенное Королевство - это разные вещи. А безпанцирные улитки - это просто слизни. РОБОТ рОбОт робот"
replacements = {
"гуманоидный робот": "андроид",
"Соединенное Королевство": "Великобритания",
"безпанцирные улитки": "слизни",
"робот": "машина",
"РОБОТ": "АВТОМАТ",
}
result = text_replace_by_dict(text, replacements)
print(result)
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 prlps_text_replacer-0.0.1.tar.gz.
File metadata
- Download URL: prlps_text_replacer-0.0.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff328368b4579b54b6fcb03184e13f90c48c2510a470b1856e9a171fadd38624
|
|
| MD5 |
4427aa572f8e696f042eec25efc83b4a
|
|
| BLAKE2b-256 |
456a5173e4d69e40f12fd64aa101a28f5ab29c3d63fae5dbf00263dec533fb1e
|
File details
Details for the file prlps_text_replacer-0.0.1-py3-none-any.whl.
File metadata
- Download URL: prlps_text_replacer-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5e9c3baf776a1e1bd70683a3e80386e1b252f1a086006729e07cc2f92a926f0
|
|
| MD5 |
77782b85ead3bbe9747ccc9d21ceab44
|
|
| BLAKE2b-256 |
6504552ab5abc92f6fb96d14bf1942501b70553ac042c27621bb2e4a52f7a40b
|