Package org.languagetool.rules.en
Class EnglishWordRepeatRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.WordRepeatRule
org.languagetool.rules.en.EnglishWordRepeatRule
Word repeat rule for English, to avoid false alarms in the generic word repetition rule.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()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.private booleanposIsIn(AnalyzedTokenReadings[] tokens, int position, String... posTags) private booleanrepetitionOf(String word, AnalyzedTokenReadings[] tokens, int position) Methods inherited from class org.languagetool.rules.WordRepeatRule
createRuleMatch, estimateContextForSureMatch, getDescription, match, wordRepetitionOfMethods inherited from class org.languagetool.rules.Rule
addExamplePair, addTags, addToneTags, cacheAntiPatterns, getAntiPatterns, 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
-
-
Constructor Details
-
EnglishWordRepeatRule
-
-
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
-
posIsIn
-
repetitionOf
-