Skip to main content

замена слов и фраз по словарям замен с сохранением исходного регистра

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prlps_text_replacer-0.0.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prlps_text_replacer-0.0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

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

Hashes for prlps_text_replacer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ff328368b4579b54b6fcb03184e13f90c48c2510a470b1856e9a171fadd38624
MD5 4427aa572f8e696f042eec25efc83b4a
BLAKE2b-256 456a5173e4d69e40f12fd64aa101a28f5ab29c3d63fae5dbf00263dec533fb1e

See more details on using hashes here.

File details

Details for the file prlps_text_replacer-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for prlps_text_replacer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5e9c3baf776a1e1bd70683a3e80386e1b252f1a086006729e07cc2f92a926f0
MD5 77782b85ead3bbe9747ccc9d21ceab44
BLAKE2b-256 6504552ab5abc92f6fb96d14bf1942501b70553ac042c27621bb2e4a52f7a40b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page