Hi Marcro,
Try this:
<rule id="A_SUA" name="a sua">
<pattern>
<marker>
<token>sua<exception scope="previous">a</exception></token>
</marker>
<token><exception
regexp="yes">majestade|realeza|divindade</exception></token>
</pattern>
<message>Do you mean <suggestion>a sua</suggestion>?</message>
<example type="incorrect">Está tudo bem mas <marker>sua</marker> mãe
está zangada</example>
<example type="correct">Está tudo bem mas a <marker>sua</marker> mãe
está zangada.</example>
<example type="correct">Está tudo bem mas <marker>sua</marker>
majestade está zangada.</example>
</rule>
Regards,
Mike Unwalla
Contact: www.techscribe.co.uk/techw/contact.htm
-----Original Message-----
From: Marco A.G.Pinto [mailto:[email protected]]
Sent: 08 July 2013 11:57
To: Mailing List - LanguageTool
Subject: Question about creating a rule in grammar.xml (pt_PT)
Hello!
I wanted to create a special rule but I don't know how to code it.
For example: "Está tudo bem mas a sua mãe está zangada"
I wanted to add a rule that checks if the word "sua" doesn't have before an
"a" and after (exceptions) a word like: "majestade", "realeza", "divindade"
and a few others.
For example: "Está tudo bem mas sua mãe está zangada", would suggest: "a
sua".
Exceptions would be the ones above with a couple more, for example: "Está
tudo bem mas sua majestade está zangada".
This is an important enhancement in the pt_PT rules since only in Brazil
people use "sua" without the "a" before.
Thanks!
Kind regards from Marco A.G.Pinto
-----------------------
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Languagetool-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-devel