fieg/markov
最新稳定版本:1.0
Composer 安装命令:
composer require fieg/markov
包简介
Implementation of MarkovChain algorithm in PHP
README 文档
README
Implementation of MarkovChain algorithm in PHP.
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:
array(2) {
'car' =>
double(0.66666666666667)
'flowers' =>
double(0.33333333333333)
}
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-14