kuromoji-to-redpen-element
v1.0.2
Published
kuromoji to Redpen element converter
Downloads
65
Readme
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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT