Hello,
I’m currently using langTool.check(string) as described in the languageTool wiki.
In one instance I only use isDictionaryBasedSpellingRule to check the string and it runs with no errors, however when I enable all rules I get the error:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.lang3.StringUtils.equalsAny(Ljava/lang/CharSequence;[Ljava/lang/CharSequence;)Z
at org.languagetool.rules.UppercaseSentenceStartRule.isQuoteStart(UppercaseSentenceStartRule.java:189)
at org.languagetool.rules.UppercaseSentenceStartRule.match(UppercaseSentenceStartRule.java:98)
at org.languagetool.rules.TextLevelRule.match(TextLevelRule.java:39)
at org.languagetool.JLanguageTool$TextCheckCallable.getTextLevelRuleMatches(JLanguageTool.java:1136)
at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1120)
at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1084)
at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:734)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:678)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:654)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:645)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:604)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:588)
I’m using maven with the following dependency to use languageTool:
org.languagetool
language-en
4.4
This is my first time using this tool, any help would be greatly appreciated.
Thanks
This line is the problem. I’m not sure why you get version 3.3.1, but you need at least 3.5. Maven here resolves the version to 3.8.1. Maybe it makes a difference if you add languagetool-core as a dependency.