2017 © Pedro Peláez
 

library markov-chain

An implementation of the Markov chain algorithm in PHP.

image

patrickschur/markov-chain

An implementation of the Markov chain algorithm in PHP.

  • Wednesday, February 8, 2017
  • by patrickschur
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

markov-chain

Build Status codecov Minimum PHP Version License, (*1)

An implementation of the Markov chain algorithm in PHP., (*2)

Installation with Composer

$ composer require patrickschur/markov-chain

How to use

WordTokenizer

use MarkovChain\MarkovChain;
use MarkovChain\Tokenizer\WordTokenizer;

$c = new MarkovChain(new WordTokenizer());

$c->learn([
    'Lorem ipsum dolor sit amet, consetetur sadipscing elitr.',
    'At vero eos et accusam et justo duo dolores et ea rebum.',
]);

print_r($c->classify('et'));
/*
    [
        'accusam' => 0.33333333333333,
        'justo' => 0.33333333333333,
        'ea' => 0.33333333333333
    ]
*/

CharTokenizer

use MarkovChain\MarkovChain;
use MarkovChain\Tokenizer\CharTokenizer;

$c = new MarkovChain(new CharTokenizer());

$c->learn([
    'Lorem ipsum dolor sit amet, consetetur sadipscing elitr.',
    'At vero eos et accusam et justo duo dolores et ea rebum.',
]);

print_r($c->classify('a'));
/*
    [
        'm' => 0.4,
        'd' => 0.2,
        'c' => 0.2,
        'r' => 0.2
    ]
*/

The Versions

08/02 2017

dev-master

9999999-dev https://github.com/patrickschur/markov-chain

An implementation of the Markov chain algorithm in PHP.

  Sources   Download

MIT

The Requires

  • php ^7

 

The Development Requires

by Patrick Schur

chain markov

14/01 2017

v1.0

1.0.0.0 https://github.com/patrickschur/markov-chain

An implementation of the Markov chain algorithm in PHP.

  Sources   Download

MIT

The Requires

  • php ^7.0 || ^7.1

 

The Development Requires

by Patrick Schur

chain markov