Git Product home page Git Product logo

markov's Introduction

markov

A Markov Text generator in Nim (v 0.19)

Uses markov chains (https://en.wikipedia.org/wiki/Markov_chain) to generate nonsensical but somewhat grammatically valid text from one or more text files.

To build the command line utility:

nim --define:MarkovCmd c markov.nim

To use as a library just import and don't define "MarkovCmd"

To use the command line utility to generate text: markov <options>

All options have a short "-r" and a long command "--read" and are followed by an argument

Markov Order A Markov Order is the number of phrases considered to be a "state" in the markov chain. The higher this is the more like the original text your output will be.

-o <integer> or --order <integer>

Sentence Count This determines the number of sentences generated by the utility. Default is 500.

-c <integer> or --count <integer>

Load datafile This option loads a previously created sqlite database file into the markov generator.

-l <filename> or --load <filename>

Read Files This option reads files into the markov generator as sample text.

-r <textfile> or --read <textfile>

Save datafile This option (which happens after generating sentences) writes the markov generator to a sqlite datafile.

-s <filename> or --save <filename>

The save option will clear out all data if the datafile exists.

For corpus, project gutenberg is a good source of text. Of course just about any grammatically valid text will do.

Have fun.

-David Medlock

markov's People

Contributors

amedlock avatar yardanico avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.