Package org.languagetool.rules.de
Class GermanSpellerRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.spelling.SpellingCheckRule
org.languagetool.rules.spelling.hunspell.HunspellRule
org.languagetool.rules.spelling.hunspell.CompoundAwareHunspellRule
org.languagetool.rules.de.GermanSpellerRule
- Direct Known Subclasses:
AustrianGermanSpellerRule
,SwissGermanSpellerRule
public class GermanSpellerRule
extends org.languagetool.rules.spelling.hunspell.CompoundAwareHunspellRule
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GermanCompoundTokenizer
private final LineExpander
private static final int
private static final Pattern
static final String
private static final de.danielnaber.jwordsplitter.GermanWordSplitter
private final org.languagetool.synthesis.Synthesizer
private final org.languagetool.tagging.Tagger
Fields inherited from class org.languagetool.rules.spelling.hunspell.HunspellRule
FILE_EXTENSION, hunspellDict, needsInit, nonWordPattern, suggestionsOrderer
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
ConstructorsConstructorDescriptionGermanSpellerRule
(ResourceBundle messages, German language) GermanSpellerRule
(ResourceBundle messages, German language, org.languagetool.UserConfig userConfig, String languageVariantPlainTextDict) GermanSpellerRule
(ResourceBundle messages, German language, org.languagetool.UserConfig userConfig, String languageVariantPlainTextDict, List<org.languagetool.Language> altLanguages, org.languagetool.languagemodel.LanguageModel languageModel) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addIgnoreWords
(String origLine) protected void
addProhibitedWords
(List<String> words) private @Nullable String
expandLine
(String line) protected void
filterForLanguage
(List<String> suggestions) private String
getAdditionalTopSuggestions
(List<String> suggestions, String word) getCandidates
(String word) getFilteredSuggestions
(List<String> wordsOrPhrases) getId()
private @Nullable String
getParticipleForBaseform
(String baseform) private @Nullable String
private @Nullable String
private static @Nullable org.languagetool.rules.spelling.morfologik.MorfologikMultiSpeller
getSpeller
(org.languagetool.Language language, org.languagetool.UserConfig userConfig, String languageVariantPlainTextDict) private static de.danielnaber.jwordsplitter.GermanWordSplitter
getSuggestions
(String word) private @Nullable String
getWordAfterEnumerationOrNull
(List<String> words, int idx) private boolean
ignoreByHangingHyphen
(List<String> words, int idx) private boolean
private boolean
ignoreElative
(String word) protected boolean
ignoreWord
(List<String> words, int idx) protected void
init()
protected boolean
isAcceptedWordFromLanguage
(org.languagetool.Language language, String word) boolean
isMisspelled
(String word) private boolean
isNeedingFugenS
(String word) private boolean
protected boolean
isProhibited
(String word) protected boolean
isQuotedCompound
(org.languagetool.AnalyzedSentence analyzedSentence, int idx, String token) private static void
private static void
private static void
sortSuggestionByQuality
(String misspelling, List<String> suggestions) Methods inherited from class org.languagetool.rules.spelling.hunspell.CompoundAwareHunspellRule
getCandidates
Methods inherited from class org.languagetool.rules.spelling.hunspell.HunspellRule
getActiveChecks, getDescription, getDictFilenameInResources, getSentenceTextWithoutUrlsAndImmunizedTokens, match, tokenizeText
Methods inherited from class org.languagetool.rules.spelling.SpellingCheckRule
acceptedInAlternativeLanguage, acceptPhrases, addIgnoreTokens, addSuggestionsToRuleMatch, createWrongSplitMatch, filterDupes, filterSuggestions, getAdditionalProhibitFileNames, getAdditionalSpellingFileNames, getAdditionalSuggestions, getAlternativeLangSpellingRules, getAntiPatterns, getIgnoreFileName, getLanguageVariantSpellingFileName, getProhibitFileName, getSpellingFileName, ignoreToken, ignoreWord, isDictionaryBasedSpellingRule, isEMail, 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
-
RULE_ID
- See Also:
-
MAX_EDIT_DISTANCE
private static final int MAX_EDIT_DISTANCE- See Also:
-
PREVENT_SUGGESTION
-
wordsToBeIgnoredInCompounds
-
wordStartsToBeProhibited
-
wordEndingsToBeProhibited
-
ADDITIONAL_SUGGESTIONS
-
splitter
private static final de.danielnaber.jwordsplitter.GermanWordSplitter splitter -
lineExpander
-
compoundTokenizer
-
synthesizer
private final org.languagetool.synthesis.Synthesizer synthesizer -
tagger
private final org.languagetool.tagging.Tagger tagger
-
-
Constructor Details
-
GermanSpellerRule
-
GermanSpellerRule
public GermanSpellerRule(ResourceBundle messages, German language, org.languagetool.UserConfig userConfig, String languageVariantPlainTextDict) - Since:
- 4.2
-
GermanSpellerRule
public GermanSpellerRule(ResourceBundle messages, German language, org.languagetool.UserConfig userConfig, String languageVariantPlainTextDict, List<org.languagetool.Language> altLanguages, org.languagetool.languagemodel.LanguageModel languageModel) - Since:
- 4.3
-
-
Method Details
-
putRepl
-
put
-
put
-
getSplitter
private static de.danielnaber.jwordsplitter.GermanWordSplitter getSplitter() -
init
- Overrides:
init
in classorg.languagetool.rules.spelling.hunspell.HunspellRule
- Throws:
IOException
-
getId
- Overrides:
getId
in classorg.languagetool.rules.spelling.hunspell.HunspellRule
-
getCandidates
- Overrides:
getCandidates
in classorg.languagetool.rules.spelling.hunspell.CompoundAwareHunspellRule
-
isProhibited
- Overrides:
isProhibited
in classorg.languagetool.rules.spelling.SpellingCheckRule
-
addIgnoreWords
- Overrides:
addIgnoreWords
in classorg.languagetool.rules.spelling.SpellingCheckRule
-
expandLine
- Overrides:
expandLine
in classorg.languagetool.rules.spelling.SpellingCheckRule
-
getSuggestions
- Overrides:
getSuggestions
in classorg.languagetool.rules.spelling.hunspell.CompoundAwareHunspellRule
- Throws:
IOException
-
getSpeller
@Nullable private static @Nullable org.languagetool.rules.spelling.morfologik.MorfologikMultiSpeller getSpeller(org.languagetool.Language language, org.languagetool.UserConfig userConfig, String languageVariantPlainTextDict) -
filterForLanguage
- Specified by:
filterForLanguage
in classorg.languagetool.rules.spelling.hunspell.CompoundAwareHunspellRule
-
sortSuggestionByQuality
- Overrides:
sortSuggestionByQuality
in classorg.languagetool.rules.spelling.hunspell.CompoundAwareHunspellRule
-
getFilteredSuggestions
- Overrides:
getFilteredSuggestions
in classorg.languagetool.rules.spelling.hunspell.CompoundAwareHunspellRule
-
isNoun
-
ignoreElative
-
isMisspelled
- Overrides:
isMisspelled
in classorg.languagetool.rules.spelling.hunspell.HunspellRule
-
ignoreWord
- Overrides:
ignoreWord
in classorg.languagetool.rules.spelling.SpellingCheckRule
- Throws:
IOException
-
getAdditionalTopSuggestions
protected List<String> getAdditionalTopSuggestions(List<String> suggestions, String word) throws IOException - Overrides:
getAdditionalTopSuggestions
in classorg.languagetool.rules.spelling.SpellingCheckRule
- Throws:
IOException
-
getPastTenseVerbSuggestion
-
baseForThirdPersonSingularVerb
- Throws:
IOException
-
getParticipleSuggestion
-
getParticipleForBaseform
- Throws:
IOException
-
getAbbreviationSuggestion
- Throws:
IOException
-
ignoreByHangingHyphen
- Throws:
IOException
-
isNeedingFugenS
-
getWordAfterEnumerationOrNull
-
ignoreCompoundWithIgnoredWord
- Throws:
IOException
-
isQuotedCompound
protected boolean isQuotedCompound(org.languagetool.AnalyzedSentence analyzedSentence, int idx, String token) - Overrides:
isQuotedCompound
in classorg.languagetool.rules.spelling.hunspell.HunspellRule
-
addProhibitedWords
- Overrides:
addProhibitedWords
in classorg.languagetool.rules.spelling.SpellingCheckRule
-
isAcceptedWordFromLanguage
- Overrides:
isAcceptedWordFromLanguage
in classorg.languagetool.rules.spelling.hunspell.HunspellRule
-