Class AbstractEnglishSpellerRule

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static EnglishSynthesizer synthesizer  
      • 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​(java.util.ResourceBundle messages, org.languagetool.Language language)  
      AbstractEnglishSpellerRule​(java.util.ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, java.util.List<org.languagetool.Language> altLanguages)  
      AbstractEnglishSpellerRule​(java.util.ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, java.util.List<org.languagetool.Language> altLanguages, org.languagetool.languagemodel.LanguageModel languageModel)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addFormsToFirstMatch​(java.lang.String message, org.languagetool.AnalyzedSentence sentence, java.util.List<org.languagetool.rules.RuleMatch> ruleMatches, java.util.List<java.lang.String> forms)  
      protected java.util.List<java.lang.String> getAdditionalTopSuggestions​(java.util.List<java.lang.String> suggestions, java.lang.String word)  
      private @Nullable AbstractEnglishSpellerRule.IrregularForms getIrregularFormsOrNull​(java.lang.String word)  
      private @Nullable AbstractEnglishSpellerRule.IrregularForms getIrregularFormsOrNull​(java.lang.String word, java.lang.String wordSuffix, java.util.List<java.lang.String> suffixes, java.lang.String posTag, java.lang.String posName, java.lang.String formName)  
      protected java.util.List<org.languagetool.rules.RuleMatch> getRuleMatches​(java.lang.String word, int startPos, org.languagetool.AnalyzedSentence sentence, java.util.List<org.languagetool.rules.RuleMatch> ruleMatchesSoFar, int idx, org.languagetool.AnalyzedTokenReadings[] tokens)  
      protected @Nullable VariantInfo isValidInOtherVariant​(java.lang.String word)  
      protected static java.util.Map<java.lang.String,​java.lang.String> loadWordlist​(java.lang.String path, int column)  
      private void replaceFormsOfFirstMatch​(java.lang.String message, org.languagetool.AnalyzedSentence sentence, java.util.List<org.languagetool.rules.RuleMatch> ruleMatches, java.lang.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
    • Constructor Detail

      • AbstractEnglishSpellerRule

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

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

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

      • loadWordlist

        protected static java.util.Map<java.lang.String,​java.lang.String> loadWordlist​(java.lang.String path,
                                                                                             int column)
      • getRuleMatches

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

        @Nullable
        protected @Nullable VariantInfo isValidInOtherVariant​(java.lang.String word)
        Since:
        4.5
      • addFormsToFirstMatch

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

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

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

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