PHPackages                             yuzuru-s/markovchain - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yuzuru-s/markovchain

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yuzuru-s/markovchain
====================

mackovchain text builder for Japanese to use MeCab

1.0.3(9y ago)114462MITPHPPHP &gt;=5.5.0

Since Oct 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/YuzuruS/Markovchain)[ Packagist](https://packagist.org/packages/yuzuru-s/markovchain)[ Docs](https://github.com/YuzuruS/Markovchain)[ RSS](/packages/yuzuru-s-markovchain/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

PHP Library that made TEXT of Markovchain for Japanese by MeCab
===============================================================

[](#php-library-that-made-text-of-markovchain-for-japanese-by-mecab)

[![Coverage Status](https://camo.githubusercontent.com/c2749f4714f41dadd4d4565820a6a120ac6cb7fb910e4938650e3d033a5f87a0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f59757a757275532f4d61726b6f76636861696e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/YuzuruS/Markovchain?branch=master)[![Build Status](https://camo.githubusercontent.com/0953bb86c6610f324277a1302f80c61ad877df63a104c771cd56aa50bef641bc/68747470733a2f2f7472617669732d63692e6f72672f59757a757275532f4d61726b6f76636861696e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/YuzuruS/Markovchain)[![Stable Version](https://camo.githubusercontent.com/f311133e89dbf48dd92f0b75f1a9b97bf568381cd992a674285548d863f1e9b5/68747470733a2f2f706f7365722e707567782e6f72672f79757a7572752d732f4d61726b6f76636861696e2f762f737461626c65)](https://packagist.org/packages/yuzuru-s/Markovchain)[![Download Count](https://camo.githubusercontent.com/07b307f68e837a7c64c9f773066ef82412ba8324f3f83f14ca742b815aa58326/68747470733a2f2f706f7365722e707567782e6f72672f79757a7572752d732f4d61726b6f76636861696e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/yuzuru-s/redis-recommend)[![License](https://camo.githubusercontent.com/b24fbdb3ce0e37451c355fc4192ea9ce39fd35b5450a546f0b74816f7337bca6/68747470733a2f2f706f7365722e707567782e6f72672f79757a7572752d732f6d61726b6f76636861696e2f6c6963656e7365)](https://packagist.org/packages/yuzuru-s/markovchain)

Requirements
------------

[](#requirements)

- Mecab
- PhpMecab extension
    -
- PHP
    - > =5.5 &gt;=5.6, &gt;=7.0
- Composer

Installation
------------

[](#installation)

- Using composer

```
{
    "require": {
       "yuzuru-s/markovchain": "1.0.*"
    }
}

```

```
$ php composer.phar update yuzuru-s/markovchain --dev

```

How to use
----------

[](#how-to-use)

Please check [sample code](https://github.com/YuzuruS/markovchain/blob/master/sample/usecase.php)

```
require __DIR__ . '/vendor/autoload.php';
use YuzuruS\Mecab\Markovchain;

$mc = new Markovchain();
$text = 'ある村むらから、毎日まいにち町まちへ仕事しごとにいく男おとこがありました。どんな日ひでも、さびしい道みちを歩あるかなければならなかったのです。ある日ひのこと、男おとこはいつものごとく考かんがえながら歩あるいてきました。寒さむい朝あさで、自分じぶんの口くちや、鼻はなから出でる息いきが白しろく凍こおって見みえました。また田圃たんぼには、霜しもが真まっ白しろに降おりていて、ちょうど雪ゆきの降ふったような、ながめでありました。';
echo $mc->makeMarkovText($text);
```

OUTPUT

```
ある村むらから、ちょうど雪ゆきのごとく考かんがえながら歩あるいてきました。寒さむい朝あさで、さびしい道みちを歩あるかなければならなかったの口くちや、毎日まいに降ふった。ある村むらから、鼻は、鼻はなから出でる息いきが白しろく凍こおっていて、ちょうど雪ゆきのごとく考かんがえながら歩ある日ひでも、毎日まいには、男おとこはなから出でる息いきが白しろく凍こおってきました。ある日ひのごとく考かんがえながら歩あるいて、ちょうど雪ゆきの降おりていていて見みえました。

```

How to run unit test
--------------------

[](#how-to-run-unit-test)

Run with default setting.

```
% vendor/bin/phpunit -c phpunit.xml.dist

```

Currently tested with PHP 7.0.0

History
-------

[](#history)

License
-------

[](#license)

Copyright (c) 2016 YUZURU SUZUKI. See MIT-LICENSE for further details.

Copyright
---------

[](#copyright)

- Yuzuru Suzuki
    -

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~207 days

Total

3

Last Release

3463d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/73e354a09ba135db0f4849a7281fd1ae3602544202f5e589f7f3410d3a7b3664?d=identicon)[s1130125](/maintainers/s1130125)

---

Top Contributors

[![YuzuruS](https://avatars.githubusercontent.com/u/1485195?v=4)](https://github.com/YuzuruS "YuzuruS (68 commits)")

---

Tags

japanesemecabmarkovchain

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/yuzuru-s-markovchain/health.svg)

```
[![Health](https://phpackages.com/badges/yuzuru-s-markovchain/health.svg)](https://phpackages.com/packages/yuzuru-s-markovchain)
```

###  Alternatives

[nihongodera/limelight

A php Japanese language text analyzer and parser.

10678.9k](/packages/nihongodera-limelight)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
