Closed azu closed 5 years ago
From https://github.com/textlint-ja/textlint-rule-ja-no-redundant-expression/pull/6#issuecomment-449903529
辞書のtokenに対して名前をつけて、オプションを指定できるようにする。 いくつかのtokenに対してはデフォルトで許可リストをもつ。
id
disable
false
allow
[]
["ソフトウェア"]
Example
module.exports = [ { id: "$1を実行", message: `"$1を実行"は冗長な表現です。"$1する"など簡潔な表現にすると文章が明瞭になります。`, url: "http://www.atmarkit.co.jp/ait/articles/1001/19/news106_2.html", tokens: [ { "pos": "名詞", "pos_detail_1": "サ変接続", "_capture": "$1" }, { "surface_form": "を", "pos": "助詞", "pos_detail_1": "格助詞", "pos_detail_2": "一般", "pos_detail_3": "*", "conjugated_type": "*", "conjugated_form": "*", "basic_form": "を", "reading": "ヲ", "pronunciation": "ヲ" }, { "surface_form": "実行", "pos": "名詞", "pos_detail_1": "サ変接続", "pos_detail_2": "*", "pos_detail_3": "*", "conjugated_type": "*", "conjugated_form": "*", "basic_form": "実行", "reading": "ジッコウ", "pronunciation": "ジッコー" }, ] } ]
.textlintrc:
.textlintrc
{ "rules": { "ja-no-redundant-expression": { "dictionary": { "$1を行う": { "disable": true }, "$1を実行": { "allow": ["ソフトウェア"] // 含まれているなら無視 } } } } }
「実行」は漢字とひらがなだけをデフォルトの対象にすれば、比較的false positiveが減るんじゃないかなと思った。 カタカナと英数字の場合は許可する感じ。
プログラム、テスト
カタカナと英数字の場合は許可する感じ。
デフォルトのallowsはこれ入れた
allows
From https://github.com/textlint-ja/textlint-rule-ja-no-redundant-expression/pull/6#issuecomment-449903529
辞書のtokenに対して名前をつけて、オプションを指定できるようにする。 いくつかのtokenに対してはデフォルトで許可リストをもつ。
id
のような 名前をつけるid
に対してdisable
、デフォルトfalse
)有効/無効化できるようにする(アップデートが大変な場合も多そうなので、マイグレーション的にON/OFFできるように)allow
、デフォルト[]
or["ソフトウェア"]
など)を指定できるようにするExample
.textlintrc
: