languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
12.43k stars 1.4k forks source link

unify priorities over languages #3451

Open danielnaber opened 4 years ago

danielnaber commented 4 years ago

I just fixed a priority (https://github.com/languagetool-org/languagetool/commit/b3548024fb04ad153cdc16b89faf766898bd3cfc), but the rule (PUNCTUATION_PARAGRAPH_END) isn't specific to German. We should probably have the same priority for all rules that exist in all languages and set their priority in Language.getPriorityForId(). Affected are at least:

jaumeortola commented 4 years ago

It is fine to have a common approach for all languages. But I found that STYLE rules should have greater priority than spell checking. The spelling rule is general and the results can be unexpected. The style rules, on the other hand, are specific, solve a concrete issue and give better suggestions.

danielnaber commented 4 years ago

Could you provide some examples? I think style rules are often ignored, not just in the sense of clicking the "ignore rule" button, but also by just not reacting to the rule. In that case, a typo might be missed. Maybe we have a different idea of what "Style" means. For me, these are suggestions that often apply only to some types of texts and that can be ignored for others, like avoiding colloquial words.

jaumeortola commented 4 years ago

There were some Spanish rules in the category STYLE (nº -> n.º, Méjico -> México...) which happened to be also spelling errors. Certainly, it is not coherent. If they are "style" rules, the words should be allowed by the speller. I can change that (i.e. adding Méjico to the dictionary), or I can move the rules to other categories. But, anyway, there is no point writing a style rule that will be overwritten by a spelling rule. The style rule is just superfluous. You will always get the same result (the spelling error) with the style rule or without the style rule.

It can make sense for a user to disable style rules, but that is a different matter from priorities.

Can you provide examples of style rules that are overwritten by spelling rules, where this is a good thing?

danielnaber commented 4 years ago

Can you provide examples of style rules that are overwritten by spelling rules, where this is a good thing?

For example the "long paragraph" rule or "long sentence" rule. The user might ignore it on purpose, but it would hide a real typo if the underlined word (the one where the sentence/paragraph becomes "too long") happens to be a typo.

jaumeortola commented 4 years ago

For example the "long paragraph" rule or "long sentence" rule. The user might ignore it on purpose, but it would hide a real typo if the underlined word (the one where the sentence/paragraph becomes "too long") happens to be a typo.

Okay. If we reserve the category named STYLE for this kind of things, I will just rename the current Spanish category STYLE.

danielnaber commented 4 years ago

If we reserve the category named STYLE for this kind of things, I will just rename the current Spanish category STYLE.

Okay, thanks!

ghost commented 4 years ago

Maybe it is a good idea to define the error types (not necessarily equal to category names unless we decide to stick to those) with examples, somewhere on the wiki maybe? I have been struggling with good placement of rules from the start. So when defined better, there is a lot to move around....