Hi Marco, Here's what I would try:
<!-- COMMA BEFORE WORDS #1 --> <rulegroup id="COMMA_1" name="Vírgula antes #1"> <rule> <pattern> <marker> <token><exception regexp="yes">[,;:—\–\(]</exception></token> </marker> <token regexp="yes">mas|porém|contudo|entretanto|todavia</token> </pattern> <message>Usar vírgula: <suggestion>\1,</suggestion></message> <example correction="chocolate,">Eu gosto muito de <marker>chocolate</marker> mas não posso comer para não engordar.</example> </rule> <rule> <pattern> <marker> <token><exception regexp="yes">[,;:—\–\(]</exception></token> </marker> <token>no</token> <token>entanto</token> </pattern> <message>Usar vírgula: <suggestion>\1,</suggestion></message> <example correction="chocolate,">Eu gosto muito de <marker>chocolate</marker> no entanto não posso comer para não engordar.</example> </rule> </rulegroup> Am 26.04.2016 um 15:43 schrieb Marco A.G.Pinto: > Hello! > > Sorry for not asking before but I have been very busy and completely > forgot about it. > > How do I make it work with: > > <!-- COMMA BEFORE WORDS #1 --> > <rule id="COMMA_1" name="Vírgula antes #1"> > <pattern> > <token><exception regexp="yes">[,;:–—\(]</exception></token> > <marker> > <token regexp="yes">mas|porém|contudo|entretanto|todavia</token> > </marker> > </pattern> > <message>Usar vírgula: <suggestion>\1,</suggestion></message> > <example correction="ou seja,">Pensa primeiro, <marker>ou > seja</marker> escolhe acertadamente.</example> > </rule> > > Also, with the words: "no entanto"? > > Thanks! > > Kind regards, > >Marco A.G.Pinto > ----------------------- > > On 03/03/2016 19:03, Marcin Miłkowski wrote: >> W dniu 03.03.2016 o 19:06, Marco A.G.Pinto pisze: >>> Hello! >>> >>> The following Portuguese words require a comma before them: >>> 1) Eu gosto muito de chocolate, *mas *não posso comer para não engordar. >>> 2) Eu gosto muito de chocolate, *porém *não posso comer para não engordar. >>> 3) Eu gosto muito de chocolate, *contudo *não posso comer para não engordar. >>> 4) Eu gosto muito de chocolate, *no entanto* não posso comer para não >>> engordar. >>> 5) Eu gosto muito de chocolate, *entretanto *não posso comer para não >>> engordar. >>> 6) Eu gosto muito de chocolate, *todavia *não posso comer para não engordar. >>> >>> >>> Is there a simple way of adapting the rule Yakov helped me with the >>> other day?: >>> * <!-- OU SEJA ou seja, --> >>> <rule id="OU_SEJA" name="ou seja"> >>> <pattern> >>> <marker> >>> <token>ou</token> >>> <token>seja</token> >>> </marker> >>> <token negate="yes">,</token> >>> </pattern> >>> <message>Usar vírgula: <suggestion>\1 \2,</suggestion></message> >>> <example correction="ou seja,">Pensa primeiro, <marker>ou >>> seja</marker> escolhe acertadamente.</example> >>> </rule>* >>> >>> >>> PS-> Notice that in example 4) it is two words, not one. >> Actually, I would write it in a slightly more general way. >> >> >> <token><exception regexp="yes">[,;:–—\(]</exception></token> >> <marker> >> <token>no</token> >> <token>entanto</token> >> </marker> >> >> Why? Just because one usually use an opening parenthesis, a colon etc. >> instead of a comma in some context. And exceptions have a slightly >> different logic than negation, which may become tricky in some >> situations with regular expressions (probably not here, though). >> >> Best, >> Marcin >> >>> Thanks! >>> >>> Kind regards, >>> >Marco A.G.Pinto >>> ----------------------- >>> >>> -- >>> > > -- > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > > > > _______________________________________________ > Languagetool-devel mailing list > Languagetool-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/languagetool-devel > ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Languagetool-devel mailing list Languagetool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/languagetool-devel