2017 © Pedro Peláez
 

library markov

Implementation of MarkovChain algorithm in PHP

image

fieg/markov

Implementation of MarkovChain algorithm in PHP

  • Thursday, May 14, 2015
  • by fieg
  • Repository
  • 0 Watchers
  • 2 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Markov Chain

Implementation of MarkovChain algorithm in PHP., (*1)

Build Status, (*2)

Getting started

use Fieg\Markov\MarkovChain;

$sentences = [
    'my blue car',
    'red and blue flowers',
    'his blue car',
];

$chain = new MarkovChain();

foreach ($sentences as $sentence) {
    $tokens = explode(" ", $sentence);

    $chain->train($tokens);
}

$result = $chain->query("blue");

Which would result in:, (*3)

array(2) {
  'car' =>
  double(0.66666666666667)
  'flowers' =>
  double(0.33333333333333)
}

The Versions

14/05 2015

dev-master

9999999-dev

Implementation of MarkovChain algorithm in PHP

  Sources   Download

MIT

The Development Requires

14/05 2015

1.0

1.0.0.0

  Sources   Download

MIT

The Development Requires