elixir-markovify
Inspired by the python package Markovify, this library uses Markov Chain theory to take a body of text and create a new sentence based off of that text.
The idea of a markov chain is that given a state there is not equal probability of the next state. As the algorithm decides the next state to move to it will use this distributed probability to go down a more random path.
Example
chain = Markovify.Text.model("<sample text here>")
Markovify.Text.make_sentence(chain)Installation
If available in Hex, the package can be installed as:
-
Add
markovifyto your list of dependencies inmix.exs:
```elixir
def deps do
[{:markovify, "~> 0.1.0"}]
end
```-
Ensure
markovifyis started before your application:
```elixir
def application do
[applications: [:markovify]]
end
```