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

refactor(rule): analyze-desumasu-dearu 3.0.0へアップデート #5

Merged
merged 3 commits into from
May 5, 2016

Conversation

azu
Copy link
Member

@azu azu commented May 5, 2016

形態素解析を使うような仕組み変更し、非同期処理となった
https://github.com/azu/analyze-desumasu-dearu/releases/tag/3.0.0

@azu azu merged commit 7829a14 into master May 5, 2016
@azu azu deleted the update-analyze branch May 5, 2016 13:16
azu added a commit that referenced this pull request 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant