Question about de grammar.xml

Hi guys, how are you?
Recently i sign in for become a maintainer in PT-BR, i receive mail to talk with maintainer from European Portuguese Marco, i did it. But now i have a question, should i create a new grammar.xml file? a new folder or how/what i do to start with rules?

Thanks All;
Best Regards, Matheus Poletto - Brazil

Hi Matheus,

you can try to create a directory pt-BR in the directory that contains grammar.xml and then put a new grammar.xml into that directory. I’m not sure if that will work without changes to the Java code, but if it doesn’t, please add new rules to the existing grammar.xml first and we’ll help you with moving them to a new file.

Regards
Daniel

Thanks for answer my topic Daniel.
The grammar.xml i should edit is available in the stand-alone version in https://www.languagetool.org/ sure? Ill try your suggestion. Thanks :blush:

When you have downloaded the .zip you’ll find the file at org/languagetool/rules/pt/grammar.xml.

Daniel, i did a new folder into org/languagetool/rules/pt/ as org/languagetool/rules/pt/pt-BR and add the grammar file to me edit there. But, when i try execute language tool with this changes and new rules i write to language pt-Br i have a big log error in screen. I try too write append in org/languagetool/rules/pt/grammar.xml file but same error comes and replace original grammar.xml with my new grammar.xml and same error.
Any ideia what should i do?

Thanks

I just tried this: I added a file org/languagetool/rules/pt/pt-BR/grammar.xml (working with the ZIP that can be downloaded, not with the source code) and it works, at least when I fix the syntax error in your file: <message> must be ended with </message>, not with <message>. Then you need to restart LT so it sees the changes in the file.

1 Like

Awesome! u sure! All rules i wrote work perfectly now. Should i keep writing more now? … Btw is possible to i add into my java project with maven dependency LanguageTool my own rules?
Thanks for u help!!! :blush:

If you “install” the modified LT locally (i.e. call mvn install) you can use it from other local Maven projects. Please create a pull request at github once you have 5-10 rules or so. Also, are all the rules specific to Brazilian Portuguese? In case they also apply to European Portuguese you should add them to the old grammar.xml (sorry, I have no idea how similar Brazilian and European Portuguese are).

Hmmm i think some can be used in both languages, so i will add it in European Portuguese if look ok. Ill write some rules and create the pull request on git.
Thanks u support Daniel.