Skip to main content

Markov's algorithm processing

Project description

Lightweight library which implements Markov algorithm (cycle of replacements) for text strings.


creating rules

from markalgo import rules
from markalgo import processing

# from text
replacement = rules.create_rules([("Norwegian blue", "parrot"), ("alive", "dead"), ("dead", "no more")])

# or from csv files
with open("notes/cicero.csv") as argumentation:
    replacement = rules.read_all_rules_from_csv_file(argumentation)

processing text…

processing.process_text("This Norwegian blue is alive", replacement)

 *"This parrot is no more"*

…or plain-text files

with open("notes/note.txt") as argumentation:

Project details

Download files

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

Files for markalgo, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size markalgo-1.0.2-py3-none-any.whl (5.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page