Back to LanguageTool Homepage - Privacy - Imprint

Adding a new language Hindi

I am Pratik.I find languageTool interesting.So I would like to contribute to languageTool by adding a language Hindi.Hindi is a language which is used by nearly 497 million people for their general use.I will be very pleased to contribute to languageTool and be a part of languageTool community.
Please guide me how do I contribute to languageTool.

Hi Pratik, thanks for your interest in LanguageTool. Please see our introduction at for a start. As Hindi is not supported yet, it cannot be selected as a language in LT, but you can write error detection rules in any other language with a similar tokenization (i.e. any language that uses whitespace between words, as most languages do).

So as a first step you can write simple rules that refer to words, not yet to the words’ part-of-speech. Later a dictionary could be added for that. We’d be happy to welcome you as a contributor, just let us know if you have any questions (here or on our mailing list).


Is their any way to add hindi ?

It’s documented at But I recommend to first write your rules in the grammar.xml file of a different language. Once you’ve written some rules, the developers can help you with this step if you’re not familiar with Java.

I’m a java developer.How do i begin to write grammer.xml file.The languages other then Hindi I know is English.Should I first write grammer.xml files for english and then for Hindi?

I suggest you take the English grammar.xml, delete the English rules and add your rules there for Hindi. Later, when you have added Hindi as a language, you can copy your rules to the Hindi grammar.xml. Have you already forked LanguageTool at github? I suggest you do so, and work in that fork until Hindi is ready to be included into the “official” LanguageTool.

How to write rules is documented at

I added few rules but when i tried to open languagetool.jar it showed error.Whereas when rules were in hindi it worked fine.
For e.g. rule looks alike:-

<rule name="संभव मुद्रण गलती" type="गलत वर्तनी">    
    <rule id="कि कुंजि" name="कि कुंजि  (की कुंजी)">    
                    <token >कि</token>
                    <token >कुंजि</token>
                <message>क्या आपका तात्पर्य <suggestion><match no="1"/>की कुंजी </suggestion>से हैं ?</message>
                <example type="correct">समय, सफलता  <marker>की कुंजी </marker>है।</example>
                <example type="incorrect" correction="की कुंजी">समय, सफलता <marker>कि कुंजि</marker>है।</example>


What was the exact error message?

C:\Users\pratikbsp\LanguageTool-2.8>java -jar languagetool.jar
java.lang.RuntimeException: Cannot load or parse input stre
am of ‘/org/languagetool/rules/en/grammar.xml’
at org.languagetool.gui.LanguageToolSupport.reloadLanguageTool(LanguageT
at org.languagetool.gui.LanguageToolSupport.init(LanguageToolSupport.jav
at org.languagetool.gui.LanguageToolSupport.(LanguageToolSupport.j
at org.languagetool.gui.Main.createGUI(
at org.languagetool.gui.Main.access$1800(
at org.languagetool.gui.Main$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$200(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
at java.awt.EventDispatchThread.pumpEvents(

    at java.awt.EventDispatchThread.pumpEvents(


Caused by: Cannot load or parse input stream of ‘/org/langu
at org.languagetool.rules.patterns.PatternRuleLoader.getRules(PatternRul
at org.languagetool.Language.getPatternRules(
at org.languagetool.JLanguageTool.activateDefaultPatternRules(JLanguageT
at org.languagetool.gui.LanguageToolSupport.reloadLanguageTool(LanguageT
… 19 more
Caused by: java.lang.IllegalArgumentException: No IssueType found for name ‘???
???’. Valid values: [terminology, mistranslation, omission, untranslated, add
ition, duplication, inconsistency, grammar, legal, register, locale-specific-con
tent, locale-violation, style, characters, misspelling, typographical, formattin
g, inconsistent-entities, numbers, markup, pattern-problem, whitespace, internat
ionalization, length, non-conformance, uncategorized, other]
at org.languagetool.rules.ITSIssueType.getIssueType(
at org.languagetool.rules.patterns.PatternRuleHandler.prepareRule(Patter
at org.languagetool.rules.patterns.PatternRuleHandler.createRules(Patter
at org.languagetool.rules.patterns.PatternRuleHandler.createRules(Patter
at org.languagetool.rules.patterns.PatternRuleHandler.createRules(Patter
at org.languagetool.rules.patterns.PatternRuleHandler.endElement(Pattern
at javax.xml.parsers.SAXParser.parse(
at org.languagetool.rules.patterns.PatternRuleLoader.getRules(PatternRul
… 22 more

it worked fine till language was english but gave this error when i added hindi

This part of the error message explains that you used an invalid value for “type” and what the valid attributes are:

No IssueType found for name '??? ??????'. Valid values: [terminology, mistranslation,
omission, untranslated, add ition, duplication, inconsistency, grammar, legal, register, locale-specific-con
tent, locale-violation, style, characters, misspelling, typographical, formatting, inconsistent-entities,
numbers, markup, pattern-problem, whitespace, internationalization, length, non-conformance,
uncategorized, other]

thanks its working now.
How many minimum rules are required to get started.I have added approx 25 rules till now.
How much time does it take to include a language.

Have you forked our github repo to make your changes? If not, please do so, so we can look at you changes.

Also, have you tested your rules against larger texts yet? We have documented this here:

I have written all the rules and have forked repository from github.But due to large size haven’t cloned it till now.Cloning got stopped in the middle a lot of time.
For checking rules against wikipedia dump
i used this
C:\Users\pratikbsp\LanguageTool-2.8\LanguageTool-wikipedia-2.9-SNAPSHOT>java -jar languagetool-wikipedia.jar check-data - - hi hiwiki-latest-pages-articles.xml it says l and f missing how do i specify l and f.

The command syntax at wasn’t up-to-date, I’ve fixed that.

i used the following command it gave me error-

C:\Users\pratikbsp\LanguageTool-2.8\LanguageTool-wikipedia-2.9-SNAPSHOT>java -ja
r languagetool-wikipedia.jar check-data -l en -f hiwiki-latest-pages-articles.xm
l -r jarasa --max-errors 100
WARNING: Could not find rule ‘jarasa’
Only these rules are enabled: [jarasa]
All spelling rules are disabled
Working on: hiwiki-latest-pages-articles.xml
Sentence limit: no limit
Error limit: 100
English: 0 total matches
English: °NaN rule matches per sentence
Exception in thread “main” hiwiki-latest-pages-ar
ticles.xml (The system cannot find the file specified)
at Method)

where do i need to put dump files and languagetool wikipedia.Do i need to specify the location of grammar.xml file for getting the id of myrule?

You can put the dump file anywhere as long as you specify the full path to it. The grammar.xml that will be used is this one: org/languagetool/rules/en/grammar.xml

I’m having difficulty in checking large dump:-
I used this command:-
C:\Users\pratikbsp>java -jar C:\Users\pratikbsp\LanguageTool-wikipedia-2.9-SNAPS
HOT\languagetool-wikipedia.jar check-data -l en -f C:\Users\pratikbsp\hiwiki-lat
est-pages-articles.xml -r jarasa --max-errors 100

it says couldn’t find rule jarasa.
Hindi rules are in en/grammar.xml
This is how rule in grammar.xml is:-

<rule id="‌jarasa" name="बस थोड़ा‌सा (बस जरा सा)">    
		<token>बस </token>
                <token >जरासा</token>
            <message>क्या आपका तात्पर्य <suggestion>बस जरा सा</suggestion> से हैं ? क्योँकि जरासा एक गलत शब्द है।</message>
            <example type="incorrect">मेरा<marker>बस जरा सा</marker>काम बचा है।</example>
	    <example type="correct">मेरा<marker>बस जरासा</marker>काम बचा है।</example>

That’s difficult to debug from here. I think you should first clone your fork of the LT repository. Here are some tips to do so for large repos:

I have cloned the repo, Sould I do this now from repo directory?