Class AbstractEnglishSpellerRule

java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.spelling.SpellingCheckRule
org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
org.languagetool.rules.en.AbstractEnglishSpellerRule
Direct Known Subclasses:
MorfologikAmericanSpellerRule, MorfologikAustralianSpellerRule, MorfologikBritishSpellerRule, MorfologikCanadianSpellerRule, MorfologikNewZealandSpellerRule, MorfologikSouthAfricanSpellerRule

public abstract class AbstractEnglishSpellerRule extends org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final EnglishSynthesizer
     

    Fields inherited from class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule

    conversionLocale, speller1, speller2, speller3

    Fields inherited from class org.languagetool.rules.spelling.SpellingCheckRule

    ignoreWordsWithLength, language, languageModel, LANGUAGETOOL, LANGUAGETOOLER, wordListLoader

    Fields inherited from class org.languagetool.rules.Rule

    messages
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractEnglishSpellerRule(ResourceBundle messages, org.languagetool.Language language)
     
    AbstractEnglishSpellerRule(ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, List<org.languagetool.Language> altLanguages)
     
    AbstractEnglishSpellerRule(ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, List<org.languagetool.Language> altLanguages, org.languagetool.languagemodel.LanguageModel languageModel)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    addFormsToFirstMatch(String message, org.languagetool.AnalyzedSentence sentence, List<org.languagetool.rules.RuleMatch> ruleMatches, List<String> forms)
     
    protected List<String>
     
     
    getIrregularFormsOrNull(String word, String wordSuffix, List<String> suffixes, String posTag, String posName, String formName)
     
    protected List<org.languagetool.rules.RuleMatch>
    getRuleMatches(String word, int startPos, org.languagetool.AnalyzedSentence sentence, List<org.languagetool.rules.RuleMatch> ruleMatchesSoFar, int idx, org.languagetool.AnalyzedTokenReadings[] tokens)
     
    protected @Nullable VariantInfo
     
    protected static Map<String,String>
    loadWordlist(String path, int column)
     
    private void
    replaceFormsOfFirstMatch(String message, org.languagetool.AnalyzedSentence sentence, List<org.languagetool.rules.RuleMatch> ruleMatches, String suggestion)
     

    Methods inherited from class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule

    getDescription, getFileName, getFrequency, getId, ignoreWord, isMisspelled, isMisspelled, isSurrogatePairCombination, match, orderSuggestions, setCheckCompound, setCompoundRegex, setIgnoreTaggedWords, setLocale, tokenizingPattern

    Methods inherited from class org.languagetool.rules.spelling.SpellingCheckRule

    acceptedInAlternativeLanguage, acceptPhrases, addIgnoreTokens, addIgnoreWords, addProhibitedWords, addSuggestionsToRuleMatch, createWrongSplitMatch, expandLine, filterDupes, filterSuggestions, getAdditionalProhibitFileNames, getAdditionalSpellingFileNames, getAdditionalSuggestions, getAlternativeLangSpellingRules, getAntiPatterns, getIgnoreFileName, getLanguageVariantSpellingFileName, getProhibitFileName, getSpellingFileName, ignoreToken, ignoreWord, init, isDictionaryBasedSpellingRule, isEMail, isProhibited, isUrl, reorderSuggestions, setConsiderIgnoreWords, setConvertsCase, startsWithIgnoredWord

    Methods inherited from class org.languagetool.rules.Rule

    addExamplePair, estimateContextForSureMatch, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getErrorTriggeringExamples, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getSentenceWithImmunization, getUrl, hasConfigurableValue, isDefaultOff, isDefaultTempOff, 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

  • Constructor Details

    • AbstractEnglishSpellerRule

      public AbstractEnglishSpellerRule(ResourceBundle messages, org.languagetool.Language language) throws IOException
      Throws:
      IOException
    • AbstractEnglishSpellerRule

      public AbstractEnglishSpellerRule(ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, List<org.languagetool.Language> altLanguages) throws IOException
      Throws:
      IOException
      Since:
      4.4
    • AbstractEnglishSpellerRule

      @Experimental public AbstractEnglishSpellerRule(ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, List<org.languagetool.Language> altLanguages, org.languagetool.languagemodel.LanguageModel languageModel) throws IOException
      Throws:
      IOException
      Since:
      4.5 optional: language model for better suggestions
  • Method Details

    • loadWordlist

      protected static Map<String,String> loadWordlist(String path, int column)
    • getRuleMatches

      protected List<org.languagetool.rules.RuleMatch> getRuleMatches(String word, int startPos, org.languagetool.AnalyzedSentence sentence, List<org.languagetool.rules.RuleMatch> ruleMatchesSoFar, int idx, org.languagetool.AnalyzedTokenReadings[] tokens) throws IOException
      Overrides:
      getRuleMatches in class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
      Throws:
      IOException
    • isValidInOtherVariant

      @Nullable protected @Nullable VariantInfo isValidInOtherVariant(String word)
      Since:
      4.5
    • addFormsToFirstMatch

      private void addFormsToFirstMatch(String message, org.languagetool.AnalyzedSentence sentence, List<org.languagetool.rules.RuleMatch> ruleMatches, List<String> forms)
    • replaceFormsOfFirstMatch

      private void replaceFormsOfFirstMatch(String message, org.languagetool.AnalyzedSentence sentence, List<org.languagetool.rules.RuleMatch> ruleMatches, String suggestion)
    • getIrregularFormsOrNull

      @Nullable private @Nullable AbstractEnglishSpellerRule.IrregularForms getIrregularFormsOrNull(String word)
    • getIrregularFormsOrNull

      @Nullable private @Nullable AbstractEnglishSpellerRule.IrregularForms getIrregularFormsOrNull(String word, String wordSuffix, List<String> suffixes, String posTag, String posName, String formName)
    • getAdditionalTopSuggestions

      protected List<String> getAdditionalTopSuggestions(List<String> suggestions, String word) throws IOException
      Overrides:
      getAdditionalTopSuggestions in class org.languagetool.rules.spelling.SpellingCheckRule
      Throws:
      IOException
      Since:
      2.7