PHPackages                             ozawa/mecab\_on\_php - 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. ozawa/mecab\_on\_php

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

ozawa/mecab\_on\_php
====================

Use MeCab on PHP

1.0.1(10y ago)027MITPHPPHP &gt;=5.3.2

Since Nov 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/tomoya-ozawa/mecab_on_php)[ Packagist](https://packagist.org/packages/ozawa/mecab_on_php)[ RSS](/packages/ozawa-mecab-on-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Mecab\_On\_PHP
==============

[](#mecab_on_php)

Description
-----------

[](#description)

形態素解析ソフト、MecabをPHP上で扱うためのクラス

Install
-------

[](#install)

composerでインストールする場合は、 `composer require ozawa/mecab_on_php`

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';
use MecabOnPhp\mecab;

// mecabのパスを指定
$mecab_path = '/usr/local/bin/mecab';

// 解析対象の文章
$text = '富士には月見草がよく似合う';

// インスタンスを生成し、実行
$mecab = new Mecab($mecab_path);
$result = $mecab->execute($text);

var_dump($result);

// array(7) {
//   [0]=>
//   array(10) {
//     ["surface_form"]=>
//     string(6) "富士"
//     ["part_of_speech"]=>
//     string(6) "名詞"
//     ["subtype1"]=>
//     string(12) "固有名詞"
//     ["subtype2"]=>
//     string(6) "地域"
//     ["subtype3"]=>
//     string(6) "一般"
//     ["conjugational form"]=>
//     string(1) "*"
//     ["conjugational type"]=>
//     string(1) "*"
//     ["original"]=>
//     string(6) "富士"
//     ["katakana"]=>
//     string(6) "フジ"
//     ["pronounce"]=>
//     string(6) "フジ"
//   }
//   [1]=>
//   array(10) {
//     ["surface_form"]=>
//     string(3) "に"

.......

```

Option
------

[](#option)

execute();の第二引数に`false`を指定すると、単語ごとの連想配列ではなく、文字列として出力されます。

```
// array(13) {
//   [0]=>
//   string(61) "我輩	名詞,一般,*,*,*,*,我輩,ワガハイ,ワガハイ"
//   [1]=>
//   string(40) "は	助詞,係助詞,*,*,*,*,は,ハ,ワ"
//   [2]=>
//   string(49) "ねこ	名詞,一般,*,*,*,*,ねこ,ネコ,ネコ"
//   [3]=>
//   string(54) "で	助動詞,*,*,*,特殊・ダ,連用形,だ,デ,デ"
//   [4]=>
//   string(75) "ある	助動詞,*,*,*,五段・ラ行アル,基本形,ある,アル,アル"
//   [5]=>
//   string(37) "。	記号,句点,*,*,*,*,。,。,。"
//   [6]=>
//   string(55) "名前	名詞,一般,*,*,*,*,名前,ナマエ,ナマエ"
//   [7]=>
//   string(40) "は	助詞,係助詞,*,*,*,*,は,ハ,ワ"
//   [8]=>
//   string(58) "まだ	副詞,助詞類接続,*,*,*,*,まだ,マダ,マダ"
//   [9]=>
//   string(83) "ない	形容詞,自立,*,*,形容詞・アウオ段,基本形,ない,ナイ,ナイ"
//   [10]=>
//   string(33) "ニャン	名詞,一般,*,*,*,*,*"
//   [11]=>
//   string(37) "。	記号,句点,*,*,*,*,。,。,。"
//   [12]=>
//   string(3) "EOS"
// }

```

Author
------

[](#author)

ozawa

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3832d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a0aaa386668a8d28b02e16a1bd8ed1de63cbe7aadef2fbce60faf47c792d3f5?d=identicon)[t.ozawa](/maintainers/t.ozawa)

---

Tags

mecab

### Embed Badge

![Health badge](/badges/ozawa-mecab-on-php/health.svg)

```
[![Health](https://phpackages.com/badges/ozawa-mecab-on-php/health.svg)](https://phpackages.com/packages/ozawa-mecab-on-php)
```

PHPackages © 2026

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