rhysd / vim-grammarous

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

Get list of categories #71

Open nabsiddiqui opened 6 years ago

nabsiddiqui commented 6 years ago

Is there a way to get the list of all the categories?

In addition, is it possible to enable all grammar checks to allow the user to choose what they want to fix?

coxley commented 5 years ago

I'd love this too. The plugin is powerful but I'm left wondering if I have all the rules/categories I need enabled or not out of the box

abers commented 5 years ago

Same. Passive voice is not enabled by default so I have no idea what other rules/categories can also be enabled! A list of what is active by default alongside a list of all available rules/categories would be much appreciated.

drselump14 commented 4 years ago

This plugin is only a wrapper of languagetool cli , the options for listing the categories/rules shoud be impletemented on languagetool cli itself. Unfortunately, there is no such option currently

atticus-sullivan commented 1 year ago

I've found this post on reddit which is supposed to enable everything. I wanted to know where these lists came from, so I searched a bit and found https://forum.languagetool.org/t/using-enablecategories-with-languagetool-cli/800/4. Seems to be that for each language supported, there is a grammar.xml file defining the rules (and categories).

So I've written some "queries" to get the categories/rules defined for a language. They need to be applied to the grammar.xml files of the desired language (example is for the english language). You'll also need https://github.com/stedolan/jq and https://github.com/kislyuk/yq (wrapper for jq which only works with json input). Optionally you can obmit yq if you've got a xml -> json converter and then directly apply jq (maybe some field names change in this case).

Turns out that the reddit post does not really enable everything (for english). At the time I'm writing, e.g. the PUNCTUATION category seems to be missing.

But be aware that some (probably most) rules that are disabled by default, are disabled because of a reason (which sometimes is already documented e.g. <rule id="LOOK_SLIKE" name="this look slike (looks like) an error" default="off"><!-- too many FPs ("He nods his <marker>head slowly</marker>.")-->). So it's up to you if you really want to enable all these rules.

I hope this helps some of you.