Class GrammalecteRule

java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.fr.GrammalecteRule

@Experimental public class GrammalecteRule extends org.languagetool.rules.Rule
Queries a local Grammalecte server.
Since:
4.6
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final long
     
    private final org.languagetool.GlobalConfig
     
    private final Set<String>
     
    private static long
     
    private static org.slf4j.Logger
     
    private final com.fasterxml.jackson.databind.ObjectMapper
     
    private static final int
     

    Fields inherited from class org.languagetool.rules.Rule

    messages
  • Constructor Summary

    Constructors
    Constructor
    Description
    GrammalecteRule(ResourceBundle messages, org.languagetool.GlobalConfig globalConfig)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    encode(String plainText)
     
     
     
    private @NotNull List<org.languagetool.rules.RuleMatch>
     
    org.languagetool.rules.RuleMatch[]
    match(org.languagetool.AnalyzedSentence sentence)
     
    private @NotNull List<org.languagetool.rules.RuleMatch>
    parseJson(InputStream inputStream)
     

    Methods inherited from class org.languagetool.rules.Rule

    addExamplePair, estimateContextForSureMatch, getAntiPatterns, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getErrorTriggeringExamples, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getSentenceWithImmunization, getUrl, hasConfigurableValue, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isOfficeDefaultOff, isOfficeDefaultOn, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setErrorTriggeringExamples, setIncorrectExamples, setLocQualityIssueType, setOfficeDefaultOff, setOfficeDefaultOn, setUrl, supportsLanguage, toRuleMatchArray, useInOffice

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      private static org.slf4j.Logger logger
    • TIMEOUT_MILLIS

      private static final int TIMEOUT_MILLIS
      See Also:
    • DOWN_INTERVAL_MILLISECONDS

      private static final long DOWN_INTERVAL_MILLISECONDS
      See Also:
    • lastRequestError

      private static long lastRequestError
    • mapper

      private final com.fasterxml.jackson.databind.ObjectMapper mapper
    • globalConfig

      private final org.languagetool.GlobalConfig globalConfig
    • ignoreRules

      private final Set<String> ignoreRules
  • Constructor Details

    • GrammalecteRule

      public GrammalecteRule(ResourceBundle messages, org.languagetool.GlobalConfig globalConfig)
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in class org.languagetool.rules.Rule
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class org.languagetool.rules.Rule
    • match

      public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence sentence) throws IOException
      Specified by:
      match in class org.languagetool.rules.Rule
      Throws:
      IOException
    • parseJson

      @NotNull private @NotNull List<org.languagetool.rules.RuleMatch> parseJson(InputStream inputStream) throws IOException
      Throws:
      IOException
    • encode

      protected String encode(String plainText) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • getMatches

      @NotNull private @NotNull List<org.languagetool.rules.RuleMatch> getMatches(Map<String,Object> match)