Adding support for a new language to LanguageTool requires setting up a new Maven project. This page will guide you through all the necessary steps. It was written for software developers with Java and Maven experience. If you aren’t a software developer, but are still willing to write XML rules for a new language, please ask on our forum. We will help you set up the new language so no programming will be required by you. If you are a developer, fork LanguageTool on github and make the following changes in your fork. Once you’ve added enough error detection rules and we’ve checked your changes, you can send a pull request. Please note that we’re only going to add a language to the official version of LanguageTool if we can assume that you will maintain that language support in the future. This means you should have maintained your fork for a few months before creating the pull request.
Note that the changes listed are just the technical changes needed so your language can be selected in LanguageTool. How useful support for the new language will be depends solely on the rules you’re going to write. These rules decide how many errors can actually be found and how many false alarms the system shows. Well-supported languages have more than 1000 rules in LanguageTool.
mvn archetype:generate -DgroupId=org.languagetool -DartifactId=**xy** -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false(replace xy with the ISO 639-1 Code of your language).
xydirectory that has just been created.
pom.xmland adapt the
src/main/java/org/languagetool/language/English.java, use your language’s name instead of
src/main/resources/META-INF/org/languagetool/language-module.properties(needs to point to your Mylanguage class, it will be loaded by LanguageTool at runtime to detect the supported languages)
src/main/resources/org/languagetool/rules/xy/grammar.xml(the main rule file, see development documentation)
xy = Mylanguageto
xybeing your language code (e.g.
fr) and Mylanguage being the language name (e.g. French)
<module>languagetool-language-modules/xy</module>to the top-level
mvn clean packagein the LanguageTool directory. The result in
languagetool-standalone/targetshould now support your new language.
resource/xy/tagset.txtthat describes the tags, like this one for English does.