Skip to main content

Markov process-based name and word generator, based on Sam Twidale's Haxe code.

Project description

https://img.shields.io/pypi/pyversions/markovname https://github.com/bicobus/pyMarkovNameGenerator/actions/workflows/tests.yml/badge.svg

pyMarkovNameGenerator

Markov chain-based name generator based on Sam Twidale implementation in Haxe. consider this work to be a python port with functionnally the same level of functionality. Feed it a list of training data, and it’ll spew out a bunch of new words.

It comes with the training data compiled by Sam, and made available under Creative Commons BY-NC 4.0.

If you appreciate this work, consider buying me a coffee.

Install using:

pip install markovname

Requirements

This software has been developped and tested with python 3.9. Any earlier version might not work.

A minor dependency on wcwidth, make sure it is installed using pip, your package manager or whatever method you are familiar with. It is only necessary if you plan to use the main module. If you’re only interested in the generator, then wcwidth can be ignored.

If you have poetry available, you can initialize a virtual environment with:

poetry install

Usage

The software reads sample data from json formatted datasets. See the data folder of this repository for examples.

usage: __main__.py [-h] [--list] [-n NUMBER] [-o ORDER] [-p PRIOR] [-g KEY] [-V] DATA

positional arguments:
  DATA                  Path containing the data sets.

optional arguments:
  -h, --help            show this help message and exit
  --list                List the various dataset available to the software.
                        (default: False)
  -n NUMBER, --number NUMBER
                        Amount of names to generate. (default: 1)
  -o ORDER, --order ORDER
                        Highest order of model to use. Will use Katz's back-
                        off model. It looks for the next letter based on the
                        last "n" letters. (default: 3)
  -p PRIOR, --prior PRIOR
                        The prior adds a constant probability that a random
                        letter is picked from the alphabet when generating a
                        new letter. Must be a number between 0 and 1.
                        (default: 0)
  -g KEY, --generate KEY
                        Which dataset to use. If not specified, use a random
                        available set instead. (default: None)
  -V, --version         show program's version number and exit

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

markovname-1.0.0.tar.gz (199.8 kB view details)

Uploaded Source

Built Distribution

markovname-1.0.0-py3-none-any.whl (209.7 kB view details)

Uploaded Python 3

File details

Details for the file markovname-1.0.0.tar.gz.

File metadata

  • Download URL: markovname-1.0.0.tar.gz
  • Upload date:
  • Size: 199.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.6 Linux/5.10.0-8-amd64

File hashes

Hashes for markovname-1.0.0.tar.gz
Algorithm Hash digest
SHA256 083e08aed1cda82be1f530b1ebf83fb5d50dde4472ca73e61e379dc3274ed36f
MD5 27ff5e9e57bb3856c8d9559e1cb8a877
BLAKE2b-256 02d2e4a1b63dc9c1ff4653a05fa377a3969b7ee37f41b375d5936d205c5dc534

See more details on using hashes here.

File details

Details for the file markovname-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: markovname-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 209.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.6 Linux/5.10.0-8-amd64

File hashes

Hashes for markovname-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bed299b44c7dcc1d552bc116846d3b94f651bcfea9685367b3b584e2801db36
MD5 167eb6854015539ef3e5769b8c098bd7
BLAKE2b-256 bc8a5576f2d9ff7e1bf628a314c607aee98528a1377a6b701aed3b7d2dfc66f1

See more details on using hashes here.

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