PHP code example of maalls / mecab-cli-to-php
1. Go to this page and download the library: Download maalls/mecab-cli-to-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
maalls / mecab-cli-to-php example snippets
use Maalls\Mecab;
$mecab = new \Maalls\Mecab();
$mecab->parseToNode('世界こんにちは');
var_dump($nodes[0]->getSurface()); // 世界こんにちは
var_dump($nodes[0]->getFeature()); // 名詞,一般,*,*,*,*,世界,セカイ,セカイ
composer install maalls/mecab-cli-to-php