Skip to content

Use tokenize instead of getTokenizer #15

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 2 commits into from
Aug 13, 2022
Merged

Conversation

k-tahiro
Copy link
Contributor

ルール間で形態素解析結果を使いまわせるようにtokenizeを使用するPRです。

@azu
Copy link
Member

azu commented Jul 31, 2022

あー、ごめんなさい。 #23 の変更でconflictしてしまいました。
rebaseできますかね?

@k-tahiro
Copy link
Contributor Author

あー、了解です。今週末にrebaseしてpushしておきます。

};
report(node, new RuleError(`同じ接続詞(${conjunctionSurface})が連続して使われています。`, padding));
}
return Promise.all(sentences.map(selectConjenction)).reduce((prev, current) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promiseに対してreduceしちゃってるっぽいですね。

const results = await Promise.all(sentences.map(selectConjenction));

的な感じですかね。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あと、 [].reduce(() => {}) は例外を投げるので、resultsが空の場合をチェックするか、reduceの第二引数を指定するかがありそうです。

(いま思うと、別に値を返してないので、reduceじゃなくても良いかもですね)

@azu azu merged commit 327db5e into textlint-ja:master Aug 13, 2022
@azu
Copy link
Member

azu commented Aug 13, 2022

ありがとうございました!
https://github.com/textlint-ja/textlint-rule-no-doubled-conjunction/releases/tag/v2.0.4

@k-tahiro k-tahiro deleted the use-tokenize branch August 18, 2022 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants