Class TextChecker

java.lang.Object
org.languagetool.server.TextChecker
Direct Known Subclasses:
V2TextChecker

abstract class TextChecker extends Object
Since:
3.4
  • Field Details

    • CONTEXT_SIZE

      protected static final int CONTEXT_SIZE
      See Also:
    • NUM_PIPELINES_PER_SETTING

      protected static final int NUM_PIPELINES_PER_SETTING
      See Also:
    • config

      protected final HTTPServerConfig config
    • logger

      private static final org.slf4j.Logger logger
    • ENCODING

      private static final String ENCODING
      See Also:
    • CACHE_STATS_PRINT

      private static final int CACHE_STATS_PRINT
      See Also:
    • languageCheckCounts

      private final Map<String,Integer> languageCheckCounts
    • workQueue

      private Queue<Runnable> workQueue
    • reqCounter

      private RequestCounter reqCounter
    • lastHiddenMatchesServerTimeout

      private long lastHiddenMatchesServerTimeout
    • identifier

      private final org.languagetool.language.LanguageIdentifier identifier
    • executorService

      private final ExecutorService executorService
    • cache

      private final org.languagetool.ResultCache cache
    • databaseLogger

      private final DatabaseLogger databaseLogger
    • logServerId

      private final Long logServerId
    • pipelinePool

      PipelinePool pipelinePool
  • Constructor Details

  • Method Details

    • setHeaders

      protected abstract void setHeaders(com.sun.net.httpserver.HttpExchange httpExchange)
    • getResponse

      protected abstract String getResponse(org.languagetool.markup.AnnotatedText text, org.languagetool.DetectedLanguage lang, org.languagetool.Language motherTongue, List<org.languagetool.rules.RuleMatch> matches, List<org.languagetool.rules.RuleMatch> hiddenMatches, String incompleteResultReason, int compactMode)
    • getPreferredVariants

      @NotNull protected abstract @NotNull List<String> getPreferredVariants(Map<String,String> parameters)
    • getLanguage

      protected abstract org.languagetool.DetectedLanguage getLanguage(String text, Map<String,String> parameters, List<String> preferredVariants, List<String> additionalDetectLangs, List<String> preferredLangs)
    • getLanguageAutoDetect

      protected abstract boolean getLanguageAutoDetect(Map<String,String> parameters)
    • getEnabledRuleIds

      @NotNull protected abstract @NotNull List<String> getEnabledRuleIds(Map<String,String> parameters)
    • getDisabledRuleIds

      @NotNull protected abstract @NotNull List<String> getDisabledRuleIds(Map<String,String> parameters)
    • prewarmPipelinePool

      private void prewarmPipelinePool()
    • shutdownNow

      void shutdownNow()
    • checkText

      void checkText(org.languagetool.markup.AnnotatedText aText, com.sun.net.httpserver.HttpExchange httpExchange, Map<String,String> parameters, ErrorRequestLimiter errorRequestLimiter, String remoteAddress) throws Exception
      Throws:
      Exception
    • getRuleValues

      private Map<String,Integer> getRuleValues(Map<String,String> parameters)
    • getUserDictWords

      private List<String> getUserDictWords(Long userId)
    • checkParams

      protected void checkParams(Map<String,String> parameters)
    • getRuleMatches

      private List<org.languagetool.rules.RuleMatch> getRuleMatches(org.languagetool.markup.AnnotatedText aText, org.languagetool.Language lang, org.languagetool.Language motherTongue, Map<String,String> parameters, TextChecker.QueryParams params, org.languagetool.UserConfig userConfig, org.languagetool.RuleMatchListener listener) throws Exception
      Throws:
      Exception
    • getCategoryIds

      @NotNull private @NotNull List<org.languagetool.rules.CategoryId> getCategoryIds(String paramName, Map<String,String> parameters)
    • getCommaSeparatedStrings

      @NotNull protected @NotNull List<String> getCommaSeparatedStrings(String paramName, Map<String,String> parameters)
    • detectLanguageOfString

      org.languagetool.DetectedLanguage detectLanguageOfString(String text, String fallbackLanguage, List<String> preferredVariants, List<String> noopLangs, List<String> preferredLangs)