Skip to content

Commit

Permalink
[en] improve rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tiff committed Mar 25, 2022
1 parent 01fab89 commit 8c6c025
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ protected static Map<String, List<String>> getTopSuggestionsIgnoreCase() {
s.put("MWH", Arrays.asList("MWh"));
s.put("xray", Arrays.asList("X-ray"));
s.put("xrays", Arrays.asList("X-rays"));
s.put("soo", Arrays.asList("so", "too", "son"));
return s;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100199,6 +100199,18 @@ The accident victim died from her injuries.
<message>Did you mean <suggestion>due to</suggestion>?</message>
<example correction="due to">Many restaurants will close <marker>do to</marker> the corona restrictions.</example>
</rule>
<rule default="temp_off">
<pattern>
<token>with</token>
<token>all</token>
<marker>
<token>do</token>
</marker>
<token>respect</token>
</pattern>
<message>Did you mean <suggestion>due</suggestion>?</message>
<example correction="due">With all <marker>do</marker> respect.</example>
</rule>
</rulegroup>
<rulegroup id="RITE_RIGHT" name="rite vs right">
<rule>
Expand Down Expand Up @@ -107007,8 +107019,8 @@ The accident victim died from her injuries.
</antipattern>
<antipattern>
<token>due</token>
<token regexp="yes">next|last|previous|this|every|by</token>
<token regexp="yes">week(end)?|month|year|&weekdays;|&months;</token>
<token regexp="yes">next|last|previous|this|every|by|each|first|last|upcoming</token>
<token regexp="yes">week(end)?|month|year|&weekdays;|&months;|christmas|thanksgiving|summer|winter|fall|spring|automn</token>
</antipattern>
<antipattern>
<token postag="SENT_START" />
Expand Down Expand Up @@ -107064,12 +107076,17 @@ The accident victim died from her injuries.
<token>this</token>
<token>,</token>
</antipattern>
<antipattern>
<token>due</token>
<token skip="1">in</token>
<token regexp="yes">parts?</token>
</antipattern>
<pattern>
<token postag="SENT_START|TO" postag_regexp='yes'/>
<marker>
<token>
due
<exception scope='next' regexp='yes'>course|today|tomorrow|tonight|yesterday|dates?|for|on|process|regard|respect|to|the|:|(&weekdays;)s?|&months;|&abbrevMonths;|&abbrevWeekdays;</exception>
<exception scope='next' regexp='yes'>,|course|today|tomorrow|tonight|yesterday|dates?|for|on|process|regard|respect|to|the|:|(&weekdays;)s?|&months;|&abbrevMonths;|&abbrevWeekdays;</exception>
</token>
</marker>
</pattern>
Expand All @@ -107080,10 +107097,12 @@ The accident victim died from her injuries.
<example>Due to its links to active workers' movements, the In...</example><!-- XXX All remaining FPs are in similar circumstances -->
<example>Due the unique climate in Azerbaijan, the flora is mu...</example>
<example>Due partly to the performance capabilities of modern ...</example>
<example>Due in large part to the progress he has made, we are now able to shift that effort to an individual in the region until a new hire is on board in Singapore.</example>
<example>Due primarily to an excess of optimism in our original schedule...</example>
<example>Due Friday.</example>
<example>Due Fridays.</example>
<example>Due Wed. 4/15.</example>
<example>Due first week in August.</example>
<example>Due 20th of October</example>
<example>Due this, we have no time.</example>
<example>DUE by FRIDAY.</example>
Expand Down Expand Up @@ -124743,14 +124762,16 @@ The accident victim died from her injuries.
</rule>
<rulegroup type="locale-violation" id="CURRENCY" name="Position of currency symbols: '100$' ($100)">
<rule>
<regexp>([\d,.]{0,10}[\d]{1,10}) ?([$€£¥฿\u8371])</regexp>
<regexp>(?&lt;!$)([\d,.]{0,10}[\d]{1,10})\s?([$€£¥฿\u8371])(?!\d)</regexp>
<message>The currency mark is usually put at the beginning of the number.</message>
<suggestion>\2\1</suggestion>
<short>Put currency at the beginning</short>
<example correction="$7.25">You owe me <marker>7.25$</marker>.</example>
<example correction="$100">You owe me <marker>100$</marker>.</example>
<example correction="€100,000">You owe me <marker>100,000€</marker>.</example>
<example correction="€2,500,000">You owe me <marker>2,500,000€</marker>.</example>
<example>$0.0001 $0.0005</example>
<example>Value to Enron in 2001 $5MM to $25MM.</example>
</rule>
</rulegroup>
<rule type="whitespace" id="CURRENCY_SPACE" name="Whitespace after currency symbols: '$ 100' ($100)">
Expand Down

0 comments on commit 8c6c025

Please sign in to comment.