Skip to content
Mecab morphological analyzer for kuroshiro.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status npm version

Package kuroshiro-analyzer-mecab
Description mecab morphological analyzer for kuroshiro.
Compatibility Node ✓ (>=6)


You should have mecab and corresponding dictionary installed in your environment. And make sure that your have added mecab command to your $PATH environment variable. This analyzer will invoke mecab from command line when parsing.

For install instructions of mecab, you could check the official website of mecab from here.


$ npm install kuroshiro-analyzer-mecab

Usage with kuroshiro

Configure analyzer

This analyzer utilizes mecab morphological analyzer.

The mecab-ipadic-neologd dictionary is recommanded which includes many neologisms (new word) and periodically updated.

import MecabAnalyzer from "kuroshiro-analyzer-mecab";

const analyzer = new MecabAnalyzer();

await kuroshiro.init(analyzer);

Initialization Parameters


const analyzer = new MecabAnalyzer({
    dictPath: "/usr/lib/mecab/dic/mecab-ipadic-neologd/",
    execOptions: {
        maxBuffer: 200 * 1024,
        timeout: 0
  • command: Optional mecab command (may have arguments). If set, the param dictPath is ignored
  • dictPath: Optional Path of the dictionary mecab used
  • execOptions: Optional The exec options to run mecab command. Example as below:
    // Largest amount of data in bytes allowed on stdout or stderr. see
    maxBuffer: 200 * 1024,

    // Timeout. see
    timeout: 0
You can’t perform that action at this time.