Skip to main content

Spew words using bigram frequencies

Project description

claptrap

I'll stop talking when I'm dead!

Generate random phrases using bigram frequencies. Counts some punctuation as objects when creating bigrams so it includes realistic punctuation.

Useful if you want something maybe humorous to put into text fields other than totally random strings.

import claptrap

phrasegen = claptrap.PhraseGenerator.from_dump(file='dumps/markov-dracula.xz')

for _ in range(10):
    print(phrasegen.phrase([70, 80]))

Kicks out:

Hark! Arthur. So that you? Don't want souls? I can fight in terror afoot
Ha, but all night. Me have seen and I wondered at once to keep strict injunction
That it behind us who is better to loathe it, we should get abreast of
Gold piece of one thing? His patients. Harker began to heaven where he
Could speak without getting out. Having seen her and letters: colophon
New courage is paler as she who was some evil that the reading his departure
Such a little before the horses and his seat was silent, however, I have
So strong in the towns or say sadly that the result in kindness I know
From behind us and was concerned about ten o'clock before my child was
Simply saying that the general plan. She turned to the geologic and take

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

claptrap-0.1.0.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

claptrap-0.1.0-py2.py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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