Package org.languagetool.rules.de
Class GermanFillerWordsRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.TextLevelRule
org.languagetool.rules.AbstractStatisticStyleRule
org.languagetool.rules.de.GermanFillerWordsRule
A rule that gives Hints about the use of German filler words.
The Hints are only given when the percentage of filler words per chapter/text exceeds the given limit.
A limit of 0 shows all used filler words. Direct speech or citation is excluded otherwise.
This rule detects no grammar error but gives stylistic hints (default off).
- Since:
- 4.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGermanFillerWordsRule(ResourceBundle messages, Language lang, UserConfig userConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected intconditionFulfilled(AnalyzedTokenReadings[] tokens, int nToken) Condition to generate a hint (possibly including all exceptions) Returns: < nAnalysedToken, if condition is not fulfilled >= nAnalysedToken, if condition is not fulfilled; integer is number of token which is the end hintprotected booleanCondition to generate a hint related to the sentence (possibly including all exceptions)A short description of the error this rule can detect, usually in the language of the text that is checked.getId()A string used to identify the rule in e.g.protected StringgetLimitMessage(int limit, double percent) Defines the message for hints which exceed the limitprivate booleangetManyInSentence(UserConfig userConfig) give the user the possibility to configure the functionprotected StringDefines the message for sentence related hintsprivate booleangetTwoFollowing(UserConfig userConfig) private static booleanisException(AnalyzedTokenReadings[] tokens, int num) private static booleanisTwoWordException(String first, String second) protected booleansentenceConditionFulfilled(AnalyzedTokenReadings[] tokens, int nToken) Condition to generate a hint related to the sentence (possibly including all exceptions)Methods inherited from class org.languagetool.rules.AbstractStatisticStyleRule
denominator, getNumberOfMatches, getWordCount, match, minToCheckParagraph, setWithoutDirectSpeechMethods 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
-
DEFAULT_MIN_PERCENT
private static final int DEFAULT_MIN_PERCENT- See Also:
-
DEFAULT_TWO_FOLLOWING
private static final boolean DEFAULT_TWO_FOLLOWING- See Also:
-
DEFAULT_MANY_IN_SENTENCE
private static final boolean DEFAULT_MANY_IN_SENTENCE- See Also:
-
DEFAULT_SENTENCE_MSG1
- See Also:
-
DEFAULT_SENTENCE_MSG2
- See Also:
-
fillerWords
-
testTwoFollowing
-
TestManyInSentence
-
sentenceMessage
String sentenceMessage
-
-
Constructor Details
-
GermanFillerWordsRule
-
-
Method Details
-
getTwoFollowing
-
getManyInSentence
-
isException
-
conditionFulfilled
Description copied from class:AbstractStatisticStyleRuleCondition to generate a hint (possibly including all exceptions) Returns: < nAnalysedToken, if condition is not fulfilled >= nAnalysedToken, if condition is not fulfilled; integer is number of token which is the end hint- Specified by:
conditionFulfilledin classAbstractStatisticStyleRule
-
isTwoWordException
-
sentenceConditionFulfilled
Description copied from class:AbstractStatisticStyleRuleCondition to generate a hint related to the sentence (possibly including all exceptions)- Specified by:
sentenceConditionFulfilledin classAbstractStatisticStyleRule
-
excludeDirectSpeech
protected boolean excludeDirectSpeech()Description copied from class:AbstractStatisticStyleRuleCondition to generate a hint related to the sentence (possibly including all exceptions)- Specified by:
excludeDirectSpeechin classAbstractStatisticStyleRule
-
getLimitMessage
Description copied from class:AbstractStatisticStyleRuleDefines the message for hints which exceed the limit- Specified by:
getLimitMessagein classAbstractStatisticStyleRule
-
getSentenceMessage
Description copied from class:AbstractStatisticStyleRuleDefines the message for sentence related hints- Specified by:
getSentenceMessagein classAbstractStatisticStyleRule
-
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. -
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.- Specified by:
getDescriptionin classRule
-
getConfigurePercentText
- Specified by:
getConfigurePercentTextin classAbstractStatisticStyleRule
-
getConfigureWithoutDirectSpeachText
- Specified by:
getConfigureWithoutDirectSpeachTextin classAbstractStatisticStyleRule
-
getRuleOptions
Description copied from class:AbstractStatisticStyleRulegive the user the possibility to configure the function- Overrides:
getRuleOptionsin classAbstractStatisticStyleRule
-