Package org.languagetool.rules.de
Class GermanStyleRepeatedWordRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.TextLevelRule
org.languagetool.rules.AbstractStyleRepeatedWordRule
org.languagetool.rules.de.GermanStyleRepeatedWordRule
A rule checks the appearance of same words in a sentence or in two consecutive sentences.
Only substantive, verbs and adjectives are checked.
This rule detects no grammar error but a stylistic problem (default off)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final booleanprivate static final Patternprivate static final intprivate morfologik.speller.Spellerprivate static final Stringprivate static final booleanprivate booleanFields inherited from class org.languagetool.rules.AbstractStyleRepeatedWordRule
excludeDirectSpeech, lang, linguServices, maxDistanceOfSentences -
Constructor Summary
ConstructorsConstructorDescriptionGermanStyleRepeatedWordRule(ResourceBundle messages, Language lang, UserConfig userConfig) -
Method Summary
Modifier and TypeMethodDescriptionA short description of the error this rule can detect, usually in the language of the text that is checked.getId()Override this ID by adding a language acronym (e.g.give the user the possibility to configure the functionprivate booleanisCorrectSpell(String word) is a correct spelled wordprotected booleanisExceptionPair(AnalyzedTokenReadings token1, AnalyzedTokenReadings token2) protected booleanisPartOfWord(String testTokenText, String tokenText) private booleanisSecondPartofWord(String testTokenText, String tokenText) protected booleanisTokenPair(AnalyzedTokenReadings[] tokens, int n, boolean before) Pairs of substantive are excluded like "Arm in Arm", "Seite an Seite", etc.protected booleanOnly substantive, names, verbs and adjectives are checkedprivate static booleanIs a unknown word (has only letters and no PosTag)protected Stringprotected Stringprotected Stringprotected URLsetURL(AnalyzedTokenReadings token) Methods inherited from class org.languagetool.rules.AbstractStyleRepeatedWordRule
match, minToCheckParagraphMethods inherited from class org.languagetool.rules.TextLevelRule
estimateContextForSureMatch, match, matchMethods inherited from class org.languagetool.rules.Rule
addExamplePair, addTags, addToneTags, cacheAntiPatterns, getAntiPatterns, getCategory, getCorrectExamples, getDistanceTokens, getErrorTriggeringExamples, getFullId, getIncorrectExamples, getLocQualityIssueType, getMinPrevMatches, getPriority, 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
-
SYNONYMS_URL
- See Also:
-
LETTERS
-
MAX_DISTANCE_OF_SENTENCES
private static final int MAX_DISTANCE_OF_SENTENCES- See Also:
-
EXCLUDE_DIRECT_SPEECH
private static final boolean EXCLUDE_DIRECT_SPEECH- See Also:
-
TEST_COMPOUND_WORDS
private static final boolean TEST_COMPOUND_WORDS- See Also:
-
speller
private morfologik.speller.Speller speller -
testCompoundWords
private boolean testCompoundWords
-
-
Constructor Details
-
GermanStyleRepeatedWordRule
-
-
Method Details
-
getId
Description copied from class:AbstractStyleRepeatedWordRuleOverride this ID by adding a language acronym (e.g. STYLE_REPEATED_WORD_RULE_DE) to use adjustment of maxWords by option panel- Overrides:
getIdin classAbstractStyleRepeatedWordRule
-
getDescription
Description copied from class:RuleA short description of the error this rule can detect, usually in the language of the text that is checked.- Overrides:
getDescriptionin classAbstractStyleRepeatedWordRule
-
messageSameSentence
- Specified by:
messageSameSentencein classAbstractStyleRepeatedWordRule
-
messageSentenceBefore
- Specified by:
messageSentenceBeforein classAbstractStyleRepeatedWordRule
-
messageSentenceAfter
- Specified by:
messageSentenceAfterin classAbstractStyleRepeatedWordRule
-
getRuleOptions
give the user the possibility to configure the function- Overrides:
getRuleOptionsin classAbstractStyleRepeatedWordRule
-
isCorrectSpell
is a correct spelled word -
isUnknownWord
Is a unknown word (has only letters and no PosTag) -
isTokenToCheck
Only substantive, names, verbs and adjectives are checked- Specified by:
isTokenToCheckin classAbstractStyleRepeatedWordRule
-
isTokenPair
Pairs of substantive are excluded like "Arm in Arm", "Seite an Seite", etc.- Specified by:
isTokenPairin classAbstractStyleRepeatedWordRule
-
isSecondPartofWord
-
isPartOfWord
- Overrides:
isPartOfWordin classAbstractStyleRepeatedWordRule
-
isExceptionPair
- Overrides:
isExceptionPairin classAbstractStyleRepeatedWordRule
-
setURL
- Overrides:
setURLin classAbstractStyleRepeatedWordRule- Throws:
MalformedURLException
-