Back to LanguageTool Homepage - Privacy - Imprint

[En] Can't locate the error in the rule


#1

I could not locate the error in the following code.

<!-- English rule, 2016-11-13 -->
<rule id="AGREE_WITH_03" name="agree with 03">
<pattern>
  <marker>
  <token inflected='yes'>agree</token>
  <token negate='yes'>with</token>
  </marker>
  <token postag='DT'></token>
  <token postag='NN|NNS|NN:U|NN:UN|NNP|NNPS|PRP|PRP\$' postag_regexp='yes'></token>
</pattern>
<message>Did you mean: <suggestion>agree with</suggestion>?</message>
<short>Wrong preposition: agree with (have same opinion)</short>
<example correction='agree with'>I was simply saying that I <marker>agree to</marker> that man.</example>
<example>I was simply saying that I agree with that man.</example>
</rule>

What I'm getting, is:

There are problems with your rule:
Found wrong correction(s) in sentence 'I was simply saying that I agree to that man.': '[agree with]' but expected '[agree with]'
Please make sure you selected the correct language for your rule - your selection was: English

and the simple rule editor is giving:
Error: XML validation failed: org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 57; The entity "nbsp" was referenced, but not declared.

I don't know where all the errors are taking place. Need your assistance.


(Daniel Naber) #2

When and where exactly did you try this? At http://community.languagetool.org/ruleEditor/expert I cannot reproduce the issue.


#3

Strange Thing!
I was trying the Expert mode and getting the same error over and again when I tried to copy the code from the above (here in the forum) the error disappeared. Any idea?
I'm using Notepad++ v7.1 (32-bit) on Windows 7 (x64) and using Google Chrome as the browser.
Thanks @dnaber for your response.


(Daniel Naber) #4

Sounds like there's some invisible special character somewhere in your rule, probable a non-breaking whitespace (&nbsp;), as the other message suggests. Try replacing all whitespace characters with standard spaces.


#5

Thanks, @dnaber, that might be the case I didn't think of.
I will try to replace all the TAB characters with whitespaces next time.