Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kuroshiro-analyzer-mecab

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kuroshiro-analyzer-mecab

mecab morphological analyzer for kuroshiro

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

kuroshiro-analyzer-mecab

Build Status npm version

Packagekuroshiro-analyzer-mecab
Descriptionmecab morphological analyzer for kuroshiro.
CompatibilityNode✓ (>=6)
Browser

Pre-requisite

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.

Install

$ 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

Example:

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 https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback.
    maxBuffer: 200 * 1024,

    // Timeout. see https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback.
    timeout: 0
}

Keywords

FAQs

Package last updated on 15 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc