ちぎっては投げるブログ

Programming, Android, RaspberryPi, Digital Devices, Kinkuma Hamster...

Windowsで日本語自動添削環境セットアップ ルール設定と実行編

前回の続き。

ルールのインストール

Collection of textlint rule · textlint/textlint Wiki · GitHub

から、ブログを書くのに適当なルールをインストールしていく。

npm -i install textlint-rule-no-start-duplicated-conjunction textlint-rule-web-plus-db textlint-rule-no-doubled-joshi textlint-rule-no-double-negative-ja textlint-rule-ja-no-abusage textlint-rule-no-dropping-the-ra
{
    "rules": {
        "no-start-duplicated-conjunction": {
            "interval" : 2 // interval of sentences
        },
        "web-plus-db": true,
        "no-doubled-joshi": {
            "min_interval" : 1,
            "strict": false,
            "allow": ["",""]
        },
        "no-double-negative-ja": true,
        "ja-no-abusage": true,
        "no-dropping-the-ra": true
    }
}

動かないものを整理する

私の環境では、

  • textlint-rule-no-dropping-the-ra らぬき言葉
  • textlint-rule-no-double-negative-ja 二重否定
  • textlint-rule-no-doubled-joshi 助詞の重複

が動かなかったので、しかたがなく設定ファイルから取り除いた。

前回の記事のものと合わせて、

npm -i textlint-rule-max-ten textlint-rule-no-mix-dearu-desumasu textlint-rule-preset-jtf-style textlint-rule-no-start-duplicated-conjunction textlint-rule-web-plus-db textlint-rule-ja-no-abusage
{
  "rules": {
    "max-ten": {
      "max": 4
    },
    "no-mix-dearu-desumasu": true,
    "preset-jtf-style": true,
    "no-start-duplicated-conjunction": {
        "interval" : 2 // interval of sentences
    },
    "ja-no-abusage": true,
    "web-plus-db": true
  }
}

こうなった。

試しにチェックをしてみる

適当な記事でチェックしてみる。

f:id:mczh:20161023193503p:plain

常時テザリングONのススメと、スタミナモードの相性 - ちぎっては投げるブログで試そう。

指摘は6件出た。

textlint Error web-plus-db WiFi => Wi-Fiat line 1 col 18
textlint Error web-plus-db WiFi => Wi-Fiat line 3 col 30
textlint Error web-plus-db WiFi => Wi-Fiat line 5 col 30
textlint Error web-plus-db WiFi => Wi-Fiat line 7 col 16
textlint Error web-plus-db WiFi => Wi-Fiat line 11 col 1
textlint Error max-ten 一つの文で"、"を4つ以上使用していますat line 90 col 128

残念ながら、ほとんどが表記の問題である。本質っぽい指摘は残念ながら出なかった。 動かないから抜いてしまったルールの中に、本当はチェックしたかったものが多いのも理由にありそうだ。ら抜き言葉や助詞まわりは怪しいので確認したかった。

せっかくなので、常時テザリングONのススメと、スタミナモードの相性 - ちぎっては投げるブログの記事は直しておいた。

自動添削しないよりはしたほうがマシなので、今後はATOMで書いてはてなブログにコピペするようにしよう。

……と書いていたら、コピペはダメだよコピー&ペーストだよ、と怒られた。ブログだから、コピペで良いかなと思う。