rhysd / vim-grammarous

A powerful grammar checker for Vim using LanguageTool.
1.1k stars 41 forks source link

Enabling passive voice rule via category / unable to enable categories #79

Open abers opened 5 years ago

abers commented 5 years ago

According to the README enabling the PUNCTUATION category will enable passive_voice, which doesn't work. According to the LanguageTool website, passive voice is part of the STYLE category instead. However, even with - let g:grammarous#enabled_categories = {'*' : ['PUNCTUATION', 'STYLE']} the passive voice rule is still not enabled. Am I doing something wrong? Also is there a way to see what rules/categories are enabled/disabled by default? Edit: From further testing it appears none of the rules for categories specified with g:grammarous#enabled_categories become enabled.

abers commented 5 years ago

OK, turns out PASSIVE_VOICE is a special rule that cannot be enabled via category and always has to be specifically called. Therefore the following should enable all categories and rules:

"Enable all categories
let g:grammarous#enabled_categories = {'*' : ['PUNCTUATION', 'TYPOGRAPHY', 'CASING', 'COLLOCATIONS', 'CONFUSED_WORDS', 'CREATIVE_WRITING', 'GRAMMAR', 'MISC', 'PLAIN_ENGLISH', 'TYPOS', 'REDUNDANCY', 'SEMANTICS', 'TEXT_ANALYSIS', 'STYLE', 'GENDER_NEUTRALITY']}

"Enable all special rules
let g:grammarous#enabled_rules = {'*' : ['AND_ALSO', 'ARE_ABLE_TO', 'ARTICLE_MISSING', 'AS_FAR_AS_X_IS_CONCERNED', 'BEST_EVER', 'BLEND_TOGETHER', 'BRIEF_MOMENT', 'CAN_NOT', 'CANT_HELP_BUT', 'COMMA_WHICH', 'EG_NO_COMMA', 'ELLIPSIS', 'EXACT_SAME', 'HONEST_TRUTH', 'HOPEFULLY', 'IE_NO_COMMA', 'IN_ORDER_TO', 'I_VE_A', 'NEGATE_MEANING', 'PASSIVE_VOICE', 'PLAN_ENGLISH', 'REASON_WHY', 'SENT_START_NUM', 'SERIAL_COMMA_OFF', 'SERIAL_COMMA_ON', 'SMARTPHONE', 'THREE_NN', 'TIRED_INTENSIFIERS', 'ULESLESS_THAT', 'WIKIPEDIA', 'WORLD_AROUND_IT']}

However, whilst this enables some additional rules - it doesn't enable them all.