How to use kuromojin - 1 common examples

To help you get started, we’ve selected a few kuromojin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github textlint-ja / textlint-rule-no-dropping-the-ra / src / no-dropping-the-ra.js View on Github external
[Syntax.Str](node) {
            if (helper.isChildNode(node, [Syntax.Link, Syntax.Image, Syntax.BlockQuote, Syntax.Emphasis])) {
                return;
            }
            const text = getSource(node);
            return kuromojin(text).then(tokens => {
                tokens.forEach(token => {
                    if (isKoreru(token)) {
                        report(
                            node,
                            new RuleError("ら抜き言葉を使用しています。", {
                                index: token.word_position
                            })
                        );
                    }
                });
                // tokenのペアがない場合は無視する
                if (tokens.length <= 1) {
                    return;
                }
                tokens.reduce((prev, current) => {
                    if (isTargetVerb(prev) && isRaWord(current)) {

kuromojin

Provide a high level wrapper for kuromoji.js

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis

Popular kuromojin functions