File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 61
61
## Reference
62
62
63
63
- [ Doubled Joshi Validator · Issue #460 · redpen-cc/redpen] ( https://github.com/redpen-cc/redpen/issues/460 " Doubled Joshi Validator · Issue #460 · redpen-cc/redpen ")
64
- - [ 事象の構造から見る二重デ格構文の発生 ] ( https://www.ninjal.ac.jp/event/specialists/project-meeting/files/JCLWorkshop_no6_papers/JCLWorkshop_No6_01.pdf " JCLWorkshop_No6_01.pdf ")
64
+ - [ 事象の構造から見る二重デ格構文の発生 ] ( https://www.ninjal.ac.jp/event/specialists/project-meeting/files/JCLWorkshop_no6_papers/JCLWorkshop_No6_01.pdf " JCLWorkshop_No6_01.pdf ")
65
+
66
+
67
+ ## 判定処理
68
+
69
+ ある助詞(かつ品詞細分類)が一致するものが、一定最低間隔値(距離)以下に書かれている場合を検出する。
70
+
71
+ [ 元ネタ] ( https://github.com/redpen-cc/redpen/issues/460 " Doubled Joshi Validator · Issue #460 · redpen-cc/redpen ") は助詞が1文(センテンス)に2回以上でてきた際にエラーとしてる。
72
+
73
+ 少し厳しすぎると感じたので、1文(センテンス)ではなく最低間隔値(距離)という概念を導入した
74
+
75
+ > この書籍はJavaScriptのライブラリやツールにおけるプラグインアーキテクチャを見ていく事を目的としたものです
76
+
77
+ この場合 "を" が最低間隔値2で並んでいるためエラーとするべき。
78
+
79
+ - [ kuromoji.js demo] ( http://takuyaa.github.io/kuromoji.js/demo/tokenize.html " kuromoji.js demo ")
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export default function (context, options = {}) {
67
67
let otherPosition = joshiTokens . indexOf ( current ) ;
68
68
// if difference
69
69
let differenceIndex = otherPosition - startPosition ;
70
- if ( differenceIndex < = minInterval ) {
70
+ if ( differenceIndex > = minInterval ) {
71
71
report ( node , new RuleError ( `一文に二回以上利用されている助詞 "${ key } " がみつかりました。` , {
72
72
line : sentence . loc . start . line - 1 ,
73
73
// matchLastToken.word_position start with 1
You can’t perform that action at this time.
0 commit comments