Back to LanguageTool Homepage - Privacy - Imprint

[en] New Rule (beware about/of)


#1

Incorrect sentence: Beware about the pickpockets.
Correct sentence: Beware of the pickpockets.
Please add this proposition rule to LT.

  <!-- English rule, 2016-10-19 -->
  <rule id="BEWARE_PREPOSITION" name="beware preposition">
  <pattern>
    <marker>
    <token inflected='yes'>beware</token>
    <token regexp='yes'>about|below|excepting|off|toward|above|beneath|for|on|under|across|beside|besides|from|onto|underneath|after|between|in|out|until|against|beyond|in front of|outside|up|along|but|inside|over|upon|among|by|in spite of|past|up to|around|concerning|instead of|regarding|with|at|despite|into|since|within|because of|down|like|through|without|before|during|near|throughout|with regard to|behind|except|to|with respect to|</token>
    </marker>
  </pattern>
  <message>Did you mean: <suggestion>beware of</suggestion>?</message>
  <short>Wrong preposition: beware of</short>
  <example correction='beware of'>Be careful, <marker>beware about</marker> the malware.</example>
  </rule>

(Mike Unwalla) #2

Added. Refer to https://github.com/languagetool-org/languagetool/commit/4ba491adcba005a8f749a30d9cc237dba7a14e90

I changed the second token. An alternative to a long list of prepositions, I used postag RP (= Particle [such as]: in, into, at, off, over, by, for, under) and exception for 'of'.

You must not use a space in a token or in an exception. You should not use | at the end of a regular expression. Expert mode does not find those errors (http://forum.languagetool.org/t/parse-rule-xml-does-not-find-incorrect-xml/1111).


#3

"
You must not use a space in a token or in an exception. You should not use | at the end of a regular expression. Expert mode does not find those errors (http://forum.languagetool.org/t/parse-rule-xml-does-not-find-incorrect-xml/1111).
"

Thank you, sir, for adding my rule to LT. I will take care of the usage of pipe[|] at the next time. I'm just a beginner, please bear with me. I've just started learning to write XML rules for LT. It would take some time to get familiarised with the LT XML rules.
Thank you, sir!


(Mike Unwalla) #4

@RuleFreak ,

To learn how to make rules took me a long time. Feel free to ask for help on the forum. Getting started is not easy.

To test new rules, you can use use 'testrules' (http://wiki.languagetool.org/development-overview#toc7).


#5

Thanks for your assurance, sir. I'll try my best to improve LT every way possible. It may take some time but I'll certainly overcome the difficulties involved in learning.