Skip to content

Commit de06a63

Browse files
committed
fix: 並列助詞は例外として許可するように
"登ったり降りたり" は OKに fix #19
1 parent d7d82e8 commit de06a63

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ textlint --rule no-doubled-joshi README.md
165165
166166
接続助詞 "て" の重なりは例外として許可します。
167167

168+
### 並立助詞
169+
170+
> 登っ**たり**降り**たり**する
171+
172+
並立助詞(`たり`)は連続するのが意図した助詞であるため許可します。
173+
168174
### 連語(助詞)
169175

170176
- [連語(助詞) - 修飾語 - 品詞の分類 - Weblio 辞書](http://www.weblio.jp/parts-of-speech/%E9%80%A3%E8%AA%9E(%E5%8A%A9%E8%A9%9E)_1 "連語(助詞) - 修飾語 - 品詞の分類 - Weblio 辞書")

src/no-doubled-joshi.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ function matchExceptionRule(tokens: KuromojiToken[]) {
4949
if (token.pos_detail_1 === "接続助詞" && token.surface_form === "て") {
5050
return true;
5151
}
52+
// 並立助詞は例外
53+
// 登ったり降りたり
54+
if(tokens.length === 2 && tokens[0].pos_detail_1 === "並立助詞" && tokens[1].pos_detail_1 === "並立助詞"){
55+
return true;
56+
}
5257
return false;
5358
}
5459

test/no-doubled-joshi-test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ tester.run("no-double-joshi", rule, {
1818
"そのため、文字列の長さを正確に測るにはある程度の妥協が必要になります。",
1919
"そんな事で言うべきではない。",
2020
"言うのは簡単の法則。",
21+
"台に登ったり降りたりする",
2122
// fix regression - https://travis-ci.org/textlint-ja/textlint-rule-preset-ja-technical-writing/builds/207700760#L720
2223
"慣用的表現、熟語、概数、固有名詞、副詞など、漢数字を使用することが一般的な語句では漢数字を使います。",
2324
// 1個目の「と」は格助詞、2個めの「と」は接続助詞
2425
"ターミナルで「test」**と**入力する**と**、画面に表示されます。",
26+
// 格助詞の種類が異なる
27+
// "プロパティを削除しようとするとエラーが発生します。",
2528
{
2629
text: "太字も強調も同じように無視されます。",
2730
options: {allow: ["も"]}

0 commit comments

Comments
 (0)