Back to LanguageTool Homepage - Privacy - Imprint

How to find the tab character?

I would like to make rules that find the tab character in some contexts. Is it possible, and if yes, how?

This rule partly works:

<rule id="TAB_CHARACTER" name="Find a tab character">
    <regexp>&#x9;</regexp>
    <message>Found a tab</message>
    <short>Tab</short>
    <example correction="">A tab character: a<marker>&#x9;</marker>b between a and b.</example>
    <example>No tab character.</example>
</rule>

image

But, testrules gives this warning:

Running pattern rule tests for English... Exception in thread "main" java.lang.AssertionError: English rule TAB_CHARACTE
R[1]:
"A tab character: ab between a and b."
Errors expected: 1
Errors found   : 0
Message: Found a tab
Analyzed token readings: [/SENT_START*] A[a/DT*,B-NP-singular]  [ /null*] tab[tab/NN,I-NP-singular]  [ /null*] character
[character/NN:UN,E-NP-singular] :[:/:*,O]  [ /null*] ab[ab/null,B-NP-singular|E-NP-singular]  [ /null*] between[between/
IN,B-PP]  [ /null*] a[a/NNP,B-NP-singular]  [ /null*] and[and/CC,I-NP-singular]  [ /null*] b[b/null,E-NP-singular] .[./.
*,./SENT_END*,O]
Matches: []
Regexp:
        at org.junit.Assert.fail(Assert.java:88)

Also, the right-click menu does not work fully.

W3C Schools (https://www.w3schools.com/charsets/tryit.asp?deci=9&ent=Tab) shows 3 ways to represent the tab character in HTML. If I use &Tab;, testrules gives this warning:

Exception in thread "main" java.io.IOException: Cannot load or parse '/org/languagetool/rules/en/grammar.xml'
        at org.languagetool.XMLValidator.validateWithXmlSchema(XMLValidator.java:123)
        at org.languagetool.rules.patterns.PatternRuleTest.validatePatternFile(PatternRuleTest.java:214)
        at org.languagetool.rules.patterns.PatternRuleTest.runTestForLanguage(PatternRuleTest.java:146)
        at org.languagetool.rules.patterns.PatternRuleTest.runGrammarRulesFromXmlTestIgnoringLanguages(PatternRuleTest.j
ava:141)
        at org.languagetool.rules.patterns.PatternRuleTest.main(PatternRuleTest.java:579)
Caused by: org.xml.sax.SAXParseException; lineNumber: 118; columnNumber: 26; The entity "Tab" was referenced, but not de
clared.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)