Skip to content

Commit

Permalink
[ca] improve rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jaumeortola committed Oct 21, 2024
1 parent d59ad5c commit bc5b0cb
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Catalan multiwords file used for chunking
#separatorRegExp=[\t;]
Hazte Oír;NPCNO00
José Antonio Zarzalejos;NPMSSP0
Gregorio Luri;NPMSSP0
Così fan futte;NPCSO00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31092,26 +31092,41 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
<example correction="poc temps">Tenien <marker>pocs temps</marker>.</example>
<example>En els pocs temps lliures que tenien.</example>
</rule>
<rule id="JO_HEM_DIT" name="jo hem dit > ja hem dit">
<rulegroup id="JO_HEM_DIT" name="jo hem dit > ja hem dit">
<antipattern>
<token postag="V...1S.." postag_regexp="yes"/>
<token>jo</token>
<example>I si em perdo jo ens perdrem plegats.</example>
</antipattern>
<pattern>
<marker>
<token skip="2">jo<exception scope="previous" regexp="yes">i|com|ni|o</exception><exception scope="next" negate_pos="yes" postag="&pronom_feble;|V.*|_perfet|_obligacio|_reflexiu|_GV_" postag_regexp="yes"/></token>
<token postag="V.[IS].1P.." postag_regexp="yes"/>
</marker>
</pattern>
<message>Possible confusió.</message>
<suggestion><match no="1" regexp_match="(?iu)jo" regexp_replace="ja" include_skipped="all"/> \2</suggestion>
<suggestion><match no="1" include_skipped="all"/> <match no="2" postag_regexp="yes" postag="(V.[IS].1)P(..)" postag_replace="$1S$2"/></suggestion>
<example correction="Ja ho hem|Jo ho he"><marker>Jo ho hem</marker> dit.</example>
<example>El meu amic i jo ho hem dit sempre.</example>
<example>Tant el meu amic com jo ho hem dit sempre.</example>
<example>És més jove que jo, en sumem 68.</example>
</rule>
<rule default="temp_off">
<pattern>
<marker>
<token>jo<exception scope="previous" regexp="yes">i|com|ni|o</exception></token>
<token postag="V.[IS].1P.." postag_regexp="yes"/>
</marker>
<token postag="V.P..SM." postag_regexp="yes"/>
</pattern>
<message>Possible confusió.</message>
<suggestion><match no="1" regexp_match="(?iu)jo" regexp_replace="ho" include_skipped="all"/> \2</suggestion>
<suggestion><match no="1" include_skipped="all"/> <match no="2" postag_regexp="yes" postag="(V.[IS].1)P(..)" postag_replace="$1S$2"/></suggestion>
<example correction="Ho hem|Jo he"><marker>Jo hem</marker> dit.</example>
</rule>
<rule>
<pattern>
<marker>
<token skip="2">jo<exception scope="previous" regexp="yes">i|com|ni|o</exception><exception scope="next" negate_pos="yes" postag="&pronom_feble;|V.*|_perfet|_obligacio|_reflexiu|_GV_" postag_regexp="yes"/></token>
<token postag="V.[IS].1P.." postag_regexp="yes"/>
</marker>
</pattern>
<message>Possible confusió.</message>
<suggestion><match no="1" regexp_match="(?iu)jo" regexp_replace="ja" include_skipped="all"/> \2</suggestion>
<suggestion><match no="1" include_skipped="all"/> <match no="2" postag_regexp="yes" postag="(V.[IS].1)P(..)" postag_replace="$1S$2"/></suggestion>
<example correction="Ja ho hem|Jo ho he"><marker>Jo ho hem</marker> dit.</example>
<example>El meu amic i jo ho hem dit sempre.</example>
<example>Tant el meu amic com jo ho hem dit sempre.</example>
<example>És més jove que jo, en sumem 68.</example>
</rule>
</rulegroup>
<rule id="SEGUES_SHAGUES" name="segués -> s'hagués">
<pattern>
<marker>
Expand Down Expand Up @@ -57673,6 +57688,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
<suggestion>que</suggestion>
<example correction="Que"><marker>Què</marker> a mi m'agradaria que passés això?</example>
</rule>
<rule default="temp_off">
<antipattern>
<token skip="-1">què</token>
<token>?</token>
</antipattern>
<pattern>
<token postag="N..P.*" postag_regexp="yes"/>
<marker>
<token>què</token>
</marker>
<token min="0" max="4" postag_regexp="yes" postag="&pronom_feble;|R.*"/>
<token postag="V.[IS].*" postag_regexp="yes"/>
</pattern>
<message>¿Volíeu dir <suggestion>que</suggestion>? Només s'escriu amb accent si equival a 'quina cosa'.</message>
<example correction="que">Els llibres <marker>què</marker> més m'agraden són els d'aventures.</example>
<example>Els teus amics què diuen?</example>
</rule>
</rulegroup>
<rule id="QUE_SENSE_ACCENT2" name="trobo què > trobo que">
<antipattern>
Expand Down Expand Up @@ -74153,6 +74185,32 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
</rulegroup>
</category>
<category id="INCORRECT_EXPRESSIONS" name="Expressions incorrectes" type="grammar">
<rulegroup id="ESTAR_DE_TORNADA" name="estar de tornada -> haver tornat / tornar a ser aquí" default="temp_off">
<rule>
<pattern>
<token postag="V.[IS].*" postag_regexp="yes" inflected="yes">estar<exception>estar</exception></token>
<token>de</token>
<token>tornada</token>
<token>de</token>
<token>tot</token>
</pattern>
<message>Expressió incorrecta.</message>
<suggestion>n'<match no="1" postag_regexp="yes" postag="V.(.*)" postag_replace="VA$1">haver</match> vist de tots colors</suggestion>
<example correction="n'ha vist de tots colors">En Pep <marker>està de tornada de tot</marker>.</example>
</rule>
<rule>
<pattern>
<token inflected="yes">estar</token>
<token>de</token>
<token>tornada</token>
</pattern>
<message>Expressió incorrecta.</message>
<suggestion><match no="1" postag_regexp="yes" postag="V.(.*)" postag_replace="VA$1">haver</match> tornat</suggestion>
<suggestion><match no="1" postag_regexp="yes" postag="V.(.*)" postag_replace="VM$1">tornar</match> a ser aquí</suggestion>
<suggestion><match no="1" postag_regexp="yes" postag="V.(.*)" postag_replace="VM$1">tornar</match> a ser ací</suggestion>
<example correction="Haurem tornat|Tornarem a ser aquí|Tornarem a ser ací"><marker>Estarem de tornada</marker> cap a mitjanit.</example>
</rule>
</rulegroup>
<rule id="FICARSE_EN_UN_JARDI" name="ficar-se en un jardí -> en un embolic" default="temp_off">
<pattern>
<token inflected="yes" regexp="yes" skip="2">posar|ficar<exception postag="N.*" postag_regexp="yes" scope="next"/></token>
Expand Down Expand Up @@ -85970,10 +86028,22 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
<suggestion><match no="1" include_skipped="all"/> \2</suggestion>
<suggestion><match no="1" include_skipped="following"/> \2 \3</suggestion>
<example correction="fa tres anys|tres anys enrere"><marker>fa tres anys enrere</marker>.</example>
<!-- TODO: bug? <example correction="feia mesos|mesos arrere">Des de <marker>feia mesos arrere</marker>.</example>-->
<example correction="feia mesos|mesos arrere">Des de <marker>feia mesos arrere</marker>.</example>
<example correction="feia tres mesos|tres mesos arrere">Des de <marker>feia tres mesos arrere</marker>.</example>
<example>els mateixos si fa no fa que un segle enrere</example>
</rule>
<rule id="FA_UN_TEMPS_ENRERE" name="*fa tres anys enrere" default="temp_off">
<pattern>
<token regexp="yes">fa|feia<exception scope="next">que</exception></token>
<token>un</token>
<token>temps</token>
<token regexp="yes">enrere|endarrere|arrere</token>
</pattern>
<message>Construcció incorrecta.</message>
<suggestion><match no="1"/> \2 \3</suggestion>
<suggestion>\2 \3 \4</suggestion>
<example correction="Fa un temps|Un temps enrere"><marker>Fa un temps enrere</marker>.</example>
</rule>
<rule id="RISC_DE_VIDA" name="risc de vida -> risc de mort">
<pattern>
<token inflected="yes">risc</token>
Expand Down Expand Up @@ -93578,6 +93648,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
<pattern>
<token postag="SENT_START|_PUNCT.*" postag_regexp="yes"/>
<marker>
<token min="0">i</token>
<token>a</token>
<token>tot</token>
<token>això</token>
Expand Down Expand Up @@ -99071,7 +99142,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
<token inflected="yes">ficar</token>
</marker>
<token min="0" max="4" postag="RG|LOC_ADV" postag_regexp="yes"/>
<token regexp="yes">fi|terme|nom|malalt|bo</token>
<token regexp="yes">fi|terme|nom|malalt|bo|límit|càstig</token>
</pattern>
<message>Verb inadequat en aquesta expressió.</message>
<suggestion><match no="1" postag="(V.*)" postag_regexp="yes" postag_replace="$1">posar</match></suggestion>
Expand Down Expand Up @@ -114847,7 +114918,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
<token min="0" max="4" chunk="GV"><exception inflected="yes">caure</exception></token>
<token inflected="yes">caure</token>
</pattern>
<message>El verb caure no és pronominal.</message>
<message>El verb 'caure' no és pronominal.</message>
<suggestion><match no="2" regexp_match="'" regexp_replace="e"/></suggestion>
<example correction="els">Això <marker>se'ls hi</marker> va caure.</example>
<example correction="els">Això <marker>se'ls hi</marker> ha caigut.</example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,7 @@ entendible=comprensible|intel·ligible|entenedor|entenedora
entendibles=comprensibles|intel·ligibles|entenedors|entenedores
enterado=conformitat
entonces|entonses|entonçes=aleshores|llavors
allavors|allavorens=llavors
allavors|allavorens|allavores|llavorens=llavors
envidiós=envejós
envidiosa=envejosa
envidiosos=envejosos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ contra pronòstic=contra tot pronòstic Expressió preferible.
#ca sa=casa Possible confusió.
limbe jurídic|limbes jurídics=llimbs jurídics
limbe judicial|limbes judicials=llimbs judicials
lo abans possible=com més aviat millor|tan aviat com es pugui|com més prompte millor|tan prompte com es puga
lo abans possible|l'ho abans possible=com més aviat millor|tan aviat com es pugui|com més prompte millor|tan prompte com es puga
lo més aviat possible|lo mes aviat possible=com més aviat millor|tan aviat com es pugui
lo més prompte possible|lo mes prompte possible=com més prompte millor|tan prompte com es puga
lo més possible|lo mes possible=tant com es pugui|tant com es puga
Expand Down Expand Up @@ -655,4 +655,6 @@ fill per randa=fil per randa
a l'espeta=a l'espera
cosi fan tute|cosi fan tutte=Così fan tutte
ta com=tal com
per ta que=per tal que
per ta que=per tal que
estar de tornada de tot=haver-ne vist de tots colors
estant de tornada de tot=havent-ne vist de tots colors

0 comments on commit bc5b0cb

Please sign in to comment.