Package org.languagetool.rules.pl
Class MorfologikPolishSpellerRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.spelling.SpellingCheckRule
org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
org.languagetool.rules.pl.MorfologikPolishSpellerRule
public final class MorfologikPolishSpellerRule
extends org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
-
Field Summary
FieldsModifier and TypeFieldDescriptionnon-word suffixes that should not be suggested (only morphological endings, never after a space)private static final Pattern
The set of prefixes that are not allowed to be split in the suggestions.private static final String
private final org.languagetool.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
ConstructorsConstructorDescriptionMorfologikPolishSpellerRule
(ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, List<org.languagetool.Language> altLanguages) -
Method Summary
Modifier and TypeMethodDescriptiongetId()
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) private boolean
isNotCompound
(String word) Check whether the word is a compound adjective or contains a non-splitting prefix.pruneSuggestions
(List<String> suggestions) Remove suggestions -- not really runon words using a list of non-word suffixesMethods 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
-
Field Details
-
RESOURCE_FILENAME
- See Also:
-
POLISH_TOKENIZING_CHARS
-
prefixes
The set of prefixes that are not allowed to be split in the suggestions. -
bannedSuffixes
non-word suffixes that should not be suggested (only morphological endings, never after a space) -
userConfig
private final org.languagetool.UserConfig userConfig
-
-
Constructor Details
-
MorfologikPolishSpellerRule
public MorfologikPolishSpellerRule(ResourceBundle messages, org.languagetool.Language language, org.languagetool.UserConfig userConfig, List<org.languagetool.Language> altLanguages) throws IOException - Throws:
IOException
-
-
Method Details
-
getFileName
- Specified by:
getFileName
in classorg.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
-
getId
- Specified by:
getId
in classorg.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
-
tokenizingPattern
- Overrides:
tokenizingPattern
in classorg.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
-
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 classorg.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
- Throws:
IOException
-
isNotCompound
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:
IOException
- Since:
- 2.5
-
pruneSuggestions
Remove suggestions -- not really runon words using a list of non-word suffixes- Returns:
- A list of pruned suggestions.
-