Skip to content

Commit

Permalink
[pt] Update HOURS_ABREVIATION
Browse files Browse the repository at this point in the history
 - add 'alllower' to avoid '10 H 30 MIN';
 - add sub-rules to turn "10:00h" (no minutes) into "10 h" instead of
   "10 h 00 min".
  • Loading branch information
p-goulart committed May 30, 2024
1 parent f7cc7ef commit 9dedc1a
Showing 1 changed file with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21290,27 +21290,57 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
</rule>
<!-- Both HH:MM and HH h MM min should be accepted, just not at the same time. -->
<rule> <!-- #4: HH:MM + h/hr/hrs, single token -->
<antipattern> <!-- exclude zero minutes -->
<token regexp="yes">([01]?[0-9]|2[0-3]):00(hr?s?|horas?)</token>
</antipattern>
<pattern>
<token regexp="yes">([01]?[0-9]|2[0-3]):[0-5][0-9](hr?s?|horas?)</token>
</pattern>
<message>Evite misturar formatos em indicações horárias.</message>
<suggestion><match no="1" regexp_match="(\d+):(\d+).+" regexp_replace="$1&#160;h&#160;$2"/></suggestion>
<suggestion><match no="1" regexp_match="(\d+):(\d+).+" regexp_replace="$1&#160;h&#160;$2&#160;min"/></suggestion>
<suggestion><match case_conversion="alllower" no="1" regexp_match="(\d+):(\d+).+" regexp_replace="$1&#160;h&#160;$2"/></suggestion>
<suggestion><match case_conversion="alllower" no="1" regexp_match="(\d+):(\d+).+" regexp_replace="$1&#160;h&#160;$2&#160;min"/></suggestion>
<suggestion><match no="1" regexp_match="(\d+:\d+).+" regexp_replace="$1"/></suggestion>
<example correction="14&#160;h&#160;30|14&#160;h&#160;30&#160;min|14:30">Vamos às <marker>14:30h</marker>.</example>
<example correction="3&#160;h&#160;45|3&#160;h&#160;45&#160;min|3:45">Vamos às <marker>3:45H</marker>.</example>
</rule>
<rule> <!-- #5: HH:MM + h/hr/hrs, two tokens -->
<antipattern> <!-- exclude zero minutes -->
<token regexp="yes">([01]?[0-9]|2[0-3]):00</token>
<token regexp="yes">hr?s?|horas?</token>
</antipattern>
<pattern>
<token regexp="yes">([01]?[0-9]|2[0-3]):[0-5][0-9]</token>
<token regexp="yes">hr?s?|horas?</token>
</pattern>
<message>Evite misturar formatos em indicações horárias.</message>
<suggestion><match no="1" regexp_match="(\d+):(\d+)" regexp_replace="$1&#160;h&#160;$2"/></suggestion>
<suggestion><match no="1" regexp_match="(\d+):(\d+)" regexp_replace="$1&#160;h&#160;$2&#160;min"/></suggestion>
<suggestion><match case_conversion="alllower" no="1" regexp_match="(\d+):(\d+)" regexp_replace="$1&#160;h&#160;$2"/></suggestion>
<suggestion><match case_conversion="alllower" no="1" regexp_match="(\d+):(\d+)" regexp_replace="$1&#160;h&#160;$2&#160;min"/></suggestion>
<suggestion><match no="1" regexp_match="(\d+:\d+)" regexp_replace="$1"/></suggestion>
<example correction="14&#160;h&#160;30|14&#160;h&#160;30&#160;min|14:30">Vamos às <marker>14:30 hrs</marker>.</example>
<example correction="02&#160;h&#160;52|02&#160;h&#160;52&#160;min|02:52">Vamos às <marker>02:52 HRS</marker>.</example>
</rule>
<rule> <!-- #6: HH:00 + h/hr/hrs, single token -->
<pattern>
<token regexp="yes">([01]?[0-9]|2[0-3]):00(hr?s?|horas?)</token>
</pattern>
<message>Evite misturar formatos em indicações horárias.</message>
<suggestion><match case_conversion="alllower" no="1" regexp_match="(\d+):00.+" regexp_replace="$1&#160;h"/></suggestion>
<suggestion><match no="1" regexp_match="(\d+:\d+).+" regexp_replace="$1"/></suggestion>
<example correction="14&#160;h|14:00">Vamos às <marker>14:00h</marker>.</example>
<example correction="3&#160;h|3:00">Vamos às <marker>3:00H</marker>.</example>
</rule>
<rule> <!-- #7: HH:00 + h/hr/hrs, two tokens -->
<pattern>
<token regexp="yes">([01]?[0-9]|2[0-3]):00</token>
<token regexp="yes">hr?s?|horas?</token>
</pattern>
<message>Evite misturar formatos em indicações horárias.</message>
<suggestion><match case_conversion="alllower" no="1" regexp_match="(\d+):00" regexp_replace="$1&#160;h"/></suggestion>
<suggestion><match no="1" regexp_match="(\d+:\d+)" regexp_replace="$1"/></suggestion>
<example correction="14&#160;h|14:00">Vamos às <marker>14:00 hrs</marker>.</example>
<example correction="02&#160;h|02:00">Vamos às <marker>02:00 HRS</marker>.</example>
</rule>
<rule> <!-- #6: simple number with a capital H, which *could* be a henry (unit of electrical inductance) -->
<rule> <!-- #8: simple number with a capital H, which *could* be a henry (unit of electrical inductance) -->
<pattern>
<token regexp="yes" skip="3" inflected="yes">às?|hora|horário|chegar|começar|início|fim|terminar|acabar|término|relógio|duração|durar|demorar|levar|evento|reunião|agenda</token>
<marker>
Expand All @@ -21321,7 +21351,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
<suggestion><match case_conversion="alllower" no="2" regexp_match="(\d+)H" regexp_replace="$1&#160;h"/></suggestion>
<example correction="12&#160;h">Começa às <marker>12H</marker>.</example>
</rule>
<rule> <!-- #7: simple number with a capital H, which *could* be a henry (unit of electrical inductance) -->
<rule> <!-- #9: simple number with a capital H, which *could* be a henry (unit of electrical inductance) -->
<pattern>
<token regexp="yes" skip="3" inflected="yes">às?|hora|horário|chegar|começar|início|fim|terminar|acabar|término|relógio|duração|durar|demorar|levar|evento|reunião|agenda</token>
<marker>
Expand Down

0 comments on commit 9dedc1a

Please sign in to comment.