Class MorfologikPolishSpellerRule


  • public final class MorfologikPolishSpellerRule
    extends org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Set<java.lang.String> bannedSuffixes
      non-word suffixes that should not be suggested (only morphological endings, never after a space)
      private static java.util.regex.Pattern POLISH_TOKENIZING_CHARS  
      private static java.util.Set<java.lang.String> prefixes
      The set of prefixes that are not allowed to be split in the suggestions.
      private static java.lang.String RESOURCE_FILENAME  
      private org.languagetool.UserConfig userConfig  
      • 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
      MorfologikPolishSpellerRule​(java.util.ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, java.util.List<org.languagetool.Language> altLanguages)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFileName()  
      java.lang.String getId()  
      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)  
      private boolean isNotCompound​(java.lang.String word)
      Check whether the word is a compound adjective or contains a non-splitting prefix.
      private java.util.List<java.lang.String> pruneSuggestions​(java.util.List<java.lang.String> suggestions)
      Remove suggestions -- not really runon words using a list of non-word suffixes
      java.util.regex.Pattern tokenizingPattern()  
      • Methods inherited from class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule

        getDescription, getFrequency, ignoreWord, isMisspelled, isMisspelled, isSurrogatePairCombination, match, orderSuggestions, setCheckCompound, setCompoundRegex, setIgnoreTaggedWords, setLocale
      • Methods inherited from class org.languagetool.rules.spelling.SpellingCheckRule

        acceptedInAlternativeLanguage, acceptPhrases, addIgnoreTokens, addIgnoreWords, addProhibitedWords, addSuggestionsToRuleMatch, createWrongSplitMatch, expandLine, filterDupes, filterSuggestions, getAdditionalProhibitFileNames, getAdditionalSpellingFileNames, getAdditionalSuggestions, getAdditionalTopSuggestions, 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 Detail

      • RESOURCE_FILENAME

        private static final java.lang.String RESOURCE_FILENAME
        See Also:
        Constant Field Values
      • POLISH_TOKENIZING_CHARS

        private static final java.util.regex.Pattern POLISH_TOKENIZING_CHARS
      • prefixes

        private static final java.util.Set<java.lang.String> prefixes
        The set of prefixes that are not allowed to be split in the suggestions.
      • bannedSuffixes

        private static final java.util.Set<java.lang.String> bannedSuffixes
        non-word suffixes that should not be suggested (only morphological endings, never after a space)
      • userConfig

        private final org.languagetool.UserConfig userConfig
    • Constructor Detail

      • MorfologikPolishSpellerRule

        public MorfologikPolishSpellerRule​(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
    • Method Detail

      • getFileName

        public java.lang.String getFileName()
        Specified by:
        getFileName in class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
      • getId

        public java.lang.String getId()
        Specified by:
        getId in class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
      • tokenizingPattern

        public java.util.regex.Pattern tokenizingPattern()
        Overrides:
        tokenizingPattern in class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
      • 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
      • isNotCompound

        private boolean isNotCompound​(java.lang.String word)
                               throws java.io.IOException
        Check whether the word is a compound adjective or contains a non-splitting prefix. Used to suppress false positives.
        Parameters:
        word - Word to be checked.
        Returns:
        True if the word is not a compound.
        Throws:
        java.io.IOException
        Since:
        2.5
      • pruneSuggestions

        private java.util.List<java.lang.String> pruneSuggestions​(java.util.List<java.lang.String> suggestions)
        Remove suggestions -- not really runon words using a list of non-word suffixes
        Returns:
        A list of pruned suggestions.