Skip to content

feat(rule): "には" を 一つの助詞として認識するように #16

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 3 commits into from
Mar 4, 2017

Conversation

azu
Copy link
Member

@azu azu commented Mar 4, 2017

今までは

測るにはある程度の妥協が必要になります。

という2つの助詞として認識していた。(理論的には正しい)

けど、これにより

そのため、文字列の長さを正確に測るにはある程度の妥協が必要になります。

というケースも という助詞が連続している事になっていた

close #15

* }
* @param tokens
* @returns {*}
*/
function createSurfaceKeyMap(tokens) {
// 助詞のみを対象とする
return tokens.filter(is助詞Token).reduce((keyMap, token) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

ここはいらなかった。 tokensには助詞tokensのみしかこない

const tokens = tokenizer.tokenizeForSentence(sentence.raw);
// 助詞 + 助詞は 一つの助詞として扱う
// https://github.com/textlint-ja/textlint-rule-no-doubled-joshi/issues/15
const concatTokens = concatJoishiTokens(tokens);
Copy link
Member Author

Choose a reason for hiding this comment

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

ここで助詞の結合を行う

@azu
Copy link
Member Author

azu commented Mar 4, 2017

もう何種類かテストケース欲しい

@azu azu merged commit 3d1418f into master Mar 4, 2017
@azu azu deleted the joshi_joshi branch March 4, 2017 15:53
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.

"に" と "には" を区別したい
1 participant