Skip to content

Use tokenize instead of getTokenizer #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/no-doubled-negative-ja.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// LICENSE : MIT
"use strict";
// tokens -> event emitter -> return check
import {getTokenizer} from "kuromojin";
import {tokenize} from "kuromojin";
import なくはない from "./rules/nakuha-nai";
import ないでもない from "./rules/naidemo-nai";
import ないものではない from "./rules/naimonodeha-nai";
Expand All @@ -28,9 +28,7 @@ export default function (context) {
results.push(error);
}
};
return getTokenizer().then(tokenizer => {
return tokenizer.tokenizeForSentence(text);
}).then(tokens => {
return tokenize(text).then(tokens => {
tokens.forEach(token => {
pushError(ruleなくもない(token));
pushError(ruleないでもない(token));
Expand Down