Skip to content

Commit

Permalink
Bump languagetool to 6.3, updating use of getRules method to include …
Browse files Browse the repository at this point in the history
…third Language parameter (now required)
  • Loading branch information
rhystmills committed Jan 28, 2025
1 parent a33eee1 commit 169f8ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions apps/checker/app/matchers/LanguageToolMatcher.scala
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 169f8ed

Please sign in to comment.