LanguageTool Community

LanguageTool 6.6-SNAPSHOT (2024-11-22 22:33:09 +0100)

Parse existing XML · Expert Mode

Note: this feature is still a bit incomplete

LanguageTool Rule Editor


Watch intro video

LanguageTool finds errors based on rules. Each rule has a pattern that describes an error. A simple pattern can just be a sequence of words, e.g. "bed" followed by "English", which is an error as it should probably be "bad English" instead. The text that is checked by LanguageTool is searched for this pattern, and if it is found, the text at that place is considered to have an error.

This page will help you to create new rules. As a result, you will have your rule in XML format, which you can send to the developers for inclusion in LanguageTool. Need help? Ask in our forum.

Hide the help texts, I know what I'm doing Show help texts

Set Example Sentences

Remove · Show analysis · Update analysis · Hide analysis
warning sign Your example sentences are identical
Use this analysis to see what part-of-speech tags get assigned to the words of your sentence.
You might want to use these part-of-speech tags in your error pattern in the next step.
wait symbol

Set the Error Pattern

Use this to specify the error pattern, i.e. the sequence of words that - if found in a text that is checked by LanguageTool - triggers an error message. Add a token to the pattern to add a word so your pattern gets longer and thus more specific.

Note: LanguageTool can already detect the following error(s) in your first wrong example sentence:
  • ⇳ {{element.tokenValue}} Remove
    ⇳   Token #{{elementPosition(element)}} Remove
         
    Word:
       
    warning sign Add another token instead of using spaces in a token
    warning sign This looks like a regular expression, but the "RegExp" checkbox is not checked
    Part-of-speech:

    warning sign This looks like a regular expression, but the "RegExp" checkbox is not checked
    • except: Remove    
      Word:
         
      warning sign Add another exception instead of using spaces in a token
      warning sign This looks like a regular expression, but the "RegExp" checkbox is not checked
      Part-of-speech:

      warning sign This looks like a regular expression, but the "RegExp" checkbox is not checked
      Edit Advanced Attributes ({{countAttributes(exception.attributes)}})
      = Remove

      Add another Attribute

    Add exception · Edit Advanced Attributes ({{countAttributes(element.attributes)}})
    = Remove

    Add another Attribute

  Add token to pattern · Add error marker to pattern

Set the Rule Details


warning sign You have a \x reference that's larger than the number of tokens
Use \1, \2 to refer to the first, second token etc. of the matched text.
Use 'single quotes' to mark words that will be shown as suggestions to the user.
  • Token Match #{{messageMatch.tokenNumber}}: Case conversion:
    Replace RegExp with Use $1, $2 etc to refer to (...) in the RegExp
 optional
 optional
warning sign This does not seem to be a valid HTTP or HTTPS URL
wait symbol

Check Evaluation Results

Copy the Resulting XML

Thanks for using the online rule editor. Here's your rule in the format that the developers will use to integrate your rule. If you think your rule might be useful to other users of LanguageTool, and if all the checks under 'Evaluation Results' are okay, please send this rule to the LanguageTool developers.

If you just want to use it locally, add it to the grammar.xml file of your LanguageTool installation and restart LanguageTool.

Part-of-Speech Help

{{tag.tag}}: {{tag.name}} ·