Package org.languagetool.rules
Class AbstractWordCoherencyRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.TextLevelRule
org.languagetool.rules.AbstractWordCoherencyRule
A rule that matches words for which two different spellings are used
throughout the document.
Note that this should not be used for language variations like American English vs. British English or German "alte Rechtschreibung" vs. "neue Rechtschreibung" -- that's the task of a spell checker.
- Since:
- 2.7
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
getMessage
(String word1, String word2) Get the message shown to the user if the rule matches.Maps words in both directions, e.g.match
(List<AnalyzedSentence> sentences) int
Gives back the minimum number of paragraphs to check to give back a correct result.Methods inherited from class org.languagetool.rules.TextLevelRule
estimateContextForSureMatch, match, match
Methods inherited from class org.languagetool.rules.Rule
addExamplePair, getAntiPatterns, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getDescription, getErrorTriggeringExamples, getId, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getSentenceWithImmunization, getUrl, hasConfigurableValue, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isOfficeDefaultOff, isOfficeDefaultOn, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setErrorTriggeringExamples, setIncorrectExamples, setLocQualityIssueType, setOfficeDefaultOff, setOfficeDefaultOn, setUrl, supportsLanguage, toRuleMatchArray, useInOffice
-
Constructor Details
-
AbstractWordCoherencyRule
- Throws:
IOException
-
-
Method Details
-
getWordMap
Maps words in both directions, e.g. "aufwendig -> aufwändig" and "aufwändig -> aufwendig".- Since:
- 3.0
-
getMessage
Get the message shown to the user if the rule matches. -
match
- Specified by:
match
in classTextLevelRule
-
minToCheckParagraph
public int minToCheckParagraph()Description copied from class:TextLevelRule
Gives back the minimum number of paragraphs to check to give back a correct result. Only used by LO office extension.- n == -1 --> need to check full text (use only if really needed / bad performance) examples: AbstractWordCoherencyRule, GenericUnpairedBracketsRule, ...
- n == 0 --> need only to check the current paragraph examples: MultipleWhitespaceRule, LongParagraphRule, ...
- n >= 1 --> need only to check n paragraphs around the current paragraph examples: ParagraphRepeatBeginningRule (n == 1), WordRepeatBeginningRule (n == 2), ...
- Specified by:
minToCheckParagraph
in classTextLevelRule
-