kuromoji-to-redpen-element

1.0.2 • Public • Published

kuromoji-to-redpen-element

Convert kuromoji.js's token to RedPen's TokenElement.

Installation

npm install kuromoji-to-redpen-element

Usage

const tokenize = require("kuromojin").tokenize;
import {toElements, isRedPenElement} from "kuromoji-to-redpen-element"
const text = "お刺身を食べれない。";
tokenize(text).then(tokens => {
    return toElements(tokens);
}).then(elements => {
    // elemements is array of TokenElement
    elements.forEach(element => {
        assert(isRedPenElement(element));
    });
});

See TokenElement.

RedPen documents

Tests

npm testr

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT

Package Sidebar

Install

npm i kuromoji-to-redpen-element

Weekly Downloads

15

Version

1.0.2

License

MIT

Last publish

Collaborators

  • azu