guardian / typerighter

Even if you’re the right typer, couldn’t hurt to use Typerighter!
Apache License 2.0
276 stars 12 forks source link

Allow rules and rule groups in sheet #95

Closed tjsilver closed 3 years ago

tjsilver commented 4 years ago

What does this change?

Currently, when users create a new LanguageTool custom rule we ingest the rule and wrap in a <rule> tag. This however doesn't allow users to add custom rule groups. To allow this, we now ingest the rule pre-wrapped in either a root <rule> or <rulegroup> tag, and add the id and name attributes into the root tag.

NOTE: The existing custom LT rules will need to be wrapped in <rule> or <rulegroup> at the same time that this PR is merged.

How to test

Run the branch locally and test. The CODE sheet is currently set up with wrapped rules for testing.

Test the two rulegroups and the individual rules against text with incorrect dates, ellipses and references to 'woman' or 'women' as adjectives to test the new rulegroups, e.g. "The 5th of October, January 3rd, 5th August 2017… three…four…five. There are women electricians."

How can we measure success?

Rule creators will be able to drop both rules and rule groups into the rules spreadsheet.

Have we considered potential risks?

Existing custom rules will need to be wrapped in <rule> or <rulegroup> tags in order to work in future.

tjsilver commented 4 years ago

Add custom LanguageTool rules to our google sheet, pt.2 – allow ruleGroups

jonathonherbert commented 3 years ago

NB: concluded that downtime for just a few rules is low impact, so proceeding for now. Additional tests most welcome in another PR 👍