Back to LanguageTool Homepage - Privacy - Imprint

[En] New Preposition Rule: according to


#1

Incorrect: He was acquitted as he was innocent according in the Jury.
Correct: He was acquitted as he was innocent according to the Jury.

Here is the code.
Please publish the code as this rule is not too complex and does not require much modification.

<!-- English rule, 2016-11-15 -->
<rule id="ACCORDING_TO" name="according to">
<antipattern>
    <token>according</token>
    <token postag="DT" postag_regexp="yes"></token>
</antipattern>
<antipattern>
    <token>according</token>
    <token>as</token>
    <token postag="PRP|PRP\$" postag_regexp="yes"></token>
    <token postag="VB|VBD|VBN|VBP|VBZ" postag_regexp="yes"></token>
</antipattern>

<pattern>
  <marker>
  <token>according</token>
  <token negate='yes'>to</token>
  </marker>
</pattern>
<message>Did you mean: <suggestion>according to</suggestion>? according to: (as stated/in the opinion of)</message>
<example correction='According to'><marker>According about</marker> a recent survey, most smokers suffer from cancer.</example>
<example>According to a recent survey, most smokers suffer from cancer.</example>
</rule>

(Mike Unwalla) #2

Added to my task list.

(Aside: this text is to let me post my message and avoid the error "Body is too similar to what you recently posted".)


(Mike Unwalla) #3

Done: https://github.com/languagetool-org/languagetool/commit/721c8fc3b0c659bafe548fdb4643dfa2e9b08620

Sorry that I did not do this sooner. I pushed it to the back of the list.