Liking cljdoc? Tell your friends :D

dj-marky-markov.core

A simple Markov Chain for text generation in Clojure

A simple Markov Chain for text generation in Clojure
raw docstring

-mainclj

(-main & args)

Try me out!

Try me out!
sourceraw docstring

add-entryclj

(add-entry dictionary entry)

Update dictionary with an entry tuple. If the look-up already exists, cons the current transition to the list of transitions

Update `dictionary` with an `entry` tuple.
If the look-up already exists, cons the current transition to the list of transitions
sourceraw docstring

build-markov-dictionaryclj

(build-markov-dictionary tuple-set)

Collapse tuple-set into a look-up dictionary

Collapse `tuple-set` into a look-up dictionary
sourceraw docstring

concat-with-spaceclj

(concat-with-space s1 s2)

Return s1 concatenated with s2 with a space between the two strings

Return `s1` concatenated with `s2` with a space between the two strings
sourceraw docstring

first-capital-letter-regexclj

Regex pattern to find words that start sentences

Regex pattern to find words that start sentences
sourceraw docstring

load-data!clj

(load-data! path window-length)

Load the file at path and split it into tuples of size window-length

Load the file at `path` and split it into tuples of size `window-length`
sourceraw docstring

markov-sentenceclj

(markov-sentence sentence-starters sentence-bodies window-length)

Build a sentence starting with a random element in sentence-starters, and recursively navigate the markov model in sentence-bodies, whose transition windows are sized by window-length

Build a sentence starting with a random element in `sentence-starters`, and
recursively navigate the markov model in `sentence-bodies`, whose transition windows
are sized by `window-length`
sourceraw docstring

markov-sentencesclj

(markov-sentences sentence-starters sentence-bodies window-length sentences)

Generate sentences repeatedly

Generate `sentences` repeatedly
sourceraw docstring

punctuation-regexclj

This is a loose regex detection for string terminators. Needs to be more robust

This is a loose regex detection for string terminators. Needs to be more robust
sourceraw docstring

search-textclj

(search-text stem window-length)

Take window-length words from the end of sentence to use as the look-up for the next markov transition

Take `window-length` words from the end of `sentence`
to use as the look-up for the next markov transition
sourceraw docstring

sentence-ended?clj

(sentence-ended? text)

Boolean predicate that returns true iff text contains terminal punctuation

Boolean predicate that returns true iff `text` contains terminal punctuation
sourceraw docstring

single-window-to-tupleclj

(single-window-to-tuple window)

Split window into a look-up and a transition tuple

Split `window` into a look-up and a transition tuple
sourceraw docstring

starts-sentence?clj

(starts-sentence? text-window)

Boolean predicate that returns true iff the first word of text-window starts with a capital letter

Boolean predicate that returns true iff the first word of `text-window`
starts with a capital letter
sourceraw docstring

string-to-sliding-windowclj

(string-to-sliding-window string window-length)

Convert string into a series of sliding windows that will be sliced into a window and a transition word, hence incrementing the partition window.

Convert `string` into a series of sliding windows that will be sliced into
a window and a transition word, hence incrementing the partition window.
sourceraw docstring

write-sentencesclj

(write-sentences tuples window-length copies)

Generate copies sentences from the tuples where each transition window is window-length

Generate `copies` sentences from the `tuples` where each transition window is `window-length`
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close