Package org.languagetool.rules.de
Class UnnecessaryPhraseRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.TextLevelRule
org.languagetool.rules.AbstractStatisticStyleRule
org.languagetool.rules.de.UnnecessaryPhraseRule
A rule that gives Hints about the use of German phrases.
The Hints are only given when the percentage of phrases 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:
- 5.3
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnnecessaryPhraseRule(ResourceBundle messages, Language lang, UserConfig userConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected intconditionFulfilled(AnalyzedTokenReadings[] tokens, int nAnalysedToken) 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 hintdoubleMinimal value is given in per milprotected booleanCondition to generate a hint related to the sentence (possibly including all exceptions)private static StringfirstCharToLower(AnalyzedTokenReadings[] tokens, int nToken) changes first char to upper as sentence beginA 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 limitprotected StringDefines the message for sentence related hintsprivate static booleanisException(AnalyzedTokenReadings[] tokens, String[] phrase) 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
getNumberOfMatches, getRuleOptions, 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_PER_MILL
private static final int DEFAULT_MIN_PER_MILL- See Also:
-
unnecessaryPhrases
-
-
Constructor Details
-
UnnecessaryPhraseRule
-
-
Method Details
-
denominator
public double denominator()Minimal value is given in per mil- Overrides:
denominatorin classAbstractStatisticStyleRule
-
firstCharToLower
changes first char to upper as sentence begin -
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
-
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
-