[en] New Rule (beware about/of)

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>

Added. Refer to [en] Add BEWARE_PREPOSITION · languagetool-org/languagetool@4ba491a · GitHub

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).

1 Like

"
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 (Parse Rule XML does not find incorrect XML).
"

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!

@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).

1 Like

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.