Package org.languagetool.rules.de
Class GermanWordRepeatRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.WordRepeatRule
org.languagetool.rules.de.GermanWordRepeatRule
Check if a word is repeated twice, taking into account an exception
for German where e.g. "..., die die ..." is often okay.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final List<List<PatternToken>> private final Supplier<List<DisambiguationPatternRule>> private static final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOverwrite this to avoid false alarms by ignoring these patterns - note that yourRule.match(AnalyzedSentence)method needs to callRule.getSentenceWithImmunization(org.languagetool.AnalyzedSentence)for this to be used and you need to checkAnalyzedTokenReadings.isImmunized()getId()A string used to identify the rule in e.g.booleanignore(AnalyzedTokenReadings[] tokens, int position) Implement this method to returntrueif there's a potential word repetition at the current position that should be ignored, i.e.Methods inherited from class org.languagetool.rules.WordRepeatRule
createRuleMatch, estimateContextForSureMatch, getDescription, match, wordRepetitionOfMethods inherited from class org.languagetool.rules.Rule
addExamplePair, addTags, addToneTags, cacheAntiPatterns, getCategory, getCorrectExamples, getDistanceTokens, getErrorTriggeringExamples, getFullId, getIncorrectExamples, getLocQualityIssueType, getMinPrevMatches, getPriority, getRuleOptions, getSentenceWithImmunization, getSourceFile, getSubId, getTags, getToneTags, getUrl, hasTag, hasToneTag, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isGoalSpecific, isIncludedInHiddenMatches, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setGoalSpecific, setIncludedInHiddenMatches, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setPriority, setTags, setToneTags, setUrl, supportsLanguage, toRuleMatchArray, useInOffice
-
Field Details
-
SINGLE_CHAR
-
ANTI_PATTERNS
-
antiPatterns
-
-
Constructor Details
-
GermanWordRepeatRule
-
-
Method Details
-
getId
Description copied from class:RuleA string used to identify the rule in e.g. configuration files. This string is supposed to be unique and to stay the same in all upcoming versions of LanguageTool. It's supposed to contain only the charactersA-Zand the underscore.- Overrides:
getIdin classWordRepeatRule
-
ignore
Description copied from class:WordRepeatRuleImplement this method to returntrueif there's a potential word repetition at the current position that should be ignored, i.e. if no error should be created.- Overrides:
ignorein classWordRepeatRule- Parameters:
tokens- the tokens of the sentence currently being checkedposition- the current position in the tokens- Returns:
- this implementation always returns false
-
getAntiPatterns
Description copied from class:RuleOverwrite this to avoid false alarms by ignoring these patterns - note that yourRule.match(AnalyzedSentence)method needs to callRule.getSentenceWithImmunization(org.languagetool.AnalyzedSentence)for this to be used and you need to checkAnalyzedTokenReadings.isImmunized()- Overrides:
getAntiPatternsin classRule
-