Skip to content
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

Proposal: デフォルトでは文末の"です/である"のみ検出するように #13

Closed
azu opened this issue May 10, 2016 · 0 comments · Fixed by #14
Closed

Proposal: デフォルトでは文末の"です/である"のみ検出するように #13

azu opened this issue May 10, 2016 · 0 comments · Fixed by #14
Labels
Type: Feature New Feature

Comments

@azu
Copy link
Member

azu commented May 10, 2016

textlint的にはデフォルトのルールは緩く、オプションで厳しくが妥当なので、

strict: true

をオプションに追加する。
デフォルトでは文末の"です/である"のみを対象にする。

ignoreConjunctionを利用する

@azu azu closed this as completed in #14 May 10, 2016
azu added a commit that referenced this issue May 10, 2016
`strict`オプションを導入し、デフォルトを`{ "strict": false }`としています。
そのため、デフォルトでは文末の表記のみを対象にチェックするように変更されています。

textlintでは多くのルールはfalse positiveにならないように、デフォルトを緩く設定しています。
厳しく(接続的な"である"なども)検出したい場合は、`{ "strict": true }` オプションが利用できます。

例えば、`strict:false`(デフォルト)では以下のような"である場合に"という接続的な"である"は無視されます。
そのため、次のような "であったが" は無視されています。

> OK: 昨日はいい天気であったが、今日は雨です。

`strict:false`では次のような文末が"である"や"です"といったものだけを検出します。
そのため、次の文章は"ですが"と"である"が混在しているのでエラーとなります。

> NG: 今日はいい天気である。明日も晴れです。

`strict:true`としていた場合では、以下の文章は"ですが"と"である"が混在しているのでエラーとなります。

> NG: 今日はいい天気ですが、明日は悪天候である。

-----


Q. なぜデフォルトでは文末のみの検出なのですか?
A. 自然言語に絶対の表現がないためデフォルトを緩くするためです。

Q. 2.0(以前)と同じ挙動にするにはどうすればよいですか?
A. オプションに`"strict": true`を追加してください。

2.0

```js
{
    "rules": {
        "no-mix-dearu-desumasu": {
             "preferInHeader": "", // "である" or "ですます"
             "preferInBody": "ですます",// "である" or "ですます"
             "preferInList": "である"    // "である" or "ですます"
        }
    }
}
```

3.0

```js
{
    "rules": {
        "no-mix-dearu-desumasu": {
             "preferInHeader": "", // "である" or "ですます"
             "preferInBody": "ですます",// "である" or "ですます"
             "preferInList": "である",    // "である" or "ですます"
             // 文末以外でも、敬体(ですます調)と常体(である調)を厳しくチェックするかどうか
             "strict": true
        }
    }
}
```


関連Issue

- [接続的な "である" を無視するオプション · Issue #5 · azu/analyze-desumasu-dearu](textlint-ja/analyze-desumasu-dearu#5)
- [Proposal: デフォルトでは文末の"です/である"のみ検出するように · Issue #13 · azu/textlint-rule-no-mix-dearu-desumasu](#13)



close #13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New Feature
Projects
None yet
1 participant