Liking cljdoc? Tell your friends :D

remworks.markov-chain

Implementation of Markov Chain to generate, for instance, text.

Implementation of Markov Chain to generate, for instance, text.
raw docstring

analyseclj/s

(analyse corpus & {:keys [lookback max-length] :or {lookback 2}})

Analyse corpus and return a state space. Option lookback determines the strength of the lookup key and defaults to 2. max-length will be set to largest row length in the corpus if no value is supplied.

Analyse `corpus` and return a state space.  Option `lookback` determines the
strength of the lookup key and defaults to 2.  `max-length` will be set to
largest row length in the corpus if no value is supplied.
sourceraw docstring

analyse-textclj/s

(analyse-text text & opts)

Analyse text as a corpus of lines and words.

Analyse `text` as a corpus of lines and words.
sourceraw docstring

generateclj/s

(generate {:keys [space lookback max-length] :as state-space})

Generate new chains from given state-space. When the generated chain exceeds max-length it will contain ::et-cetera it the last position. This function uses weighted to do its random picking.

Generate new chains from given `state-space`.  When the generated
chain exceeds `max-length` it will contain `::et-cetera` it the last
position.  This function uses `weighted` to do its random picking.
sourceraw docstring

generate-textclj/s

(generate-text state-space)

Generate a new sentence from are state-space.

Generate a new sentence from are `state-space`.
sourceraw docstring

split-sentencesclj/s

(split-sentences text)

Split text into sentences.

Split `text` into sentences.
sourceraw docstring

split-wordsclj/s

(split-words sentence)

Split sentence into words.

Split `sentence` into words.
sourceraw docstring

weightedclj/s

(weighted m)

Pick a random value from a weighted set given a map for values and weights. The CLJ implementation of this function uses clojure.data.generators, to get reproducible results use it's *rnd* binding .

Pick a random value from a weighted set given a map for values and
weights.  The CLJ implementation of this function uses
`clojure.data.generators`, to get reproducible results use it's
`*rnd*` binding .
sourceraw docstring

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

× close