diff --git a/apps/checker/app/matchers/LanguageToolMatcher.scala b/apps/checker/app/matchers/LanguageToolMatcher.scala index 607956a7a..6b69b27a4 100644 --- a/apps/checker/app/matchers/LanguageToolMatcher.scala +++ b/apps/checker/app/matchers/LanguageToolMatcher.scala @@ -1,8 +1,10 @@ package matchers import com.gu.typerighter.model.{Category, LTRule, LTRuleXML, RuleMatch} + import java.io.File import org.languagetool._ +import org.languagetool.language.{BritishEnglish} import org.languagetool.rules.spelling.morfologik.suggestions_ordering.SuggestionsOrdererConfig import org.languagetool.rules.{Rule => LanguageToolRule} import play.api.Logging @@ -13,7 +15,8 @@ import scala.concurrent.{ExecutionContext, Future} import org.languagetool.rules.patterns.PatternRuleLoader import org.languagetool.rules.patterns.AbstractPatternRule import utils.{Matcher, MatcherCompanion} -import scala.xml.{XML, Attribute, Null, Text} + +import scala.xml.{Attribute, Null, Text, XML} import scala.util.Try import scala.util.Success import scala.util.Failure @@ -111,7 +114,7 @@ class LanguageToolFactory( val loader = new PatternRuleLoader() getXMLStreamFromLTRules(rules) flatMap { xmlStream => { - Try(loader.getRules(xmlStream, "languagetool-generated-xml").asScala.toList) + Try(loader.getRules(xmlStream, "languagetool-generated-xml", new BritishEnglish()).asScala.toList) } } } diff --git a/build.sbt b/build.sbt index 271e9e7c8..41edd9b2e 100644 --- a/build.sbt +++ b/build.sbt @@ -24,7 +24,7 @@ ThisBuild / scalacOptions := Seq( // See https://support.snyk.io/hc/en-us/articles/9590215676189-Deeply-nested-Scala-projects-have-dependencies-truncated ThisBuild / asciiGraphWidth := 999999999 -val languageToolVersion = "6.1" +val languageToolVersion = "6.3" val awsSdkVersion = "1.12.749" val capiModelsVersion = "17.5.1" val capiClientVersion = "19.2.1"