Package org.languagetool.rules.uk
Class SimpleReplaceRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.AbstractSimpleReplaceRule
org.languagetool.rules.uk.SimpleReplaceRule
A rule that matches words which should not be used and suggests correct ones
instead.
Ukrainian implementations. Loads the relevant words from
rules/uk/replace.txt.-
Field Summary
FieldsFields inherited from class org.languagetool.rules.AbstractSimpleReplaceRule
ignoreTaggedWords, subRuleSpecificIds -
Constructor Summary
ConstructorsConstructorDescriptionSimpleReplaceRule(ResourceBundle messages, MorfologikUkrainianSpellerRule morfologikSpellerRule, Language language) -
Method Summary
Modifier and TypeMethodDescriptionfindMatches(AnalyzedTokenReadings tokenReadings, AnalyzedSentence sentence) A short description of the error this rule can detect, usually in the language of the text that is checked.final StringgetId()A string used to identify the rule in e.g.getMessage(String tokenStr, List<String> replacements) getShort()booleanIndicates if the rule is case-sensitive.private booleanisGoodPosTag(String posTag) protected booleanisTagged(AnalyzedTokenReadings tokenReadings) This method allows to override which tags will mark token as taggedMethods inherited from class org.languagetool.rules.AbstractSimpleReplaceRule
createRuleMatch, getLocale, getSynthesizer, isCheckLemmas, isTokenException, loadFromPath, loadFromPath, match, setCheckLemmas, setIgnoreTaggedWords, useSubRuleSpecificIdsMethods inherited from class org.languagetool.rules.Rule
addExamplePair, addTags, addToneTags, cacheAntiPatterns, estimateContextForSureMatch, 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
-
wrongWords
-
morfologikSpellerRule
-
-
Constructor Details
-
SimpleReplaceRule
public SimpleReplaceRule(ResourceBundle messages, MorfologikUkrainianSpellerRule morfologikSpellerRule, Language language) throws IOException - Throws:
IOException
-
-
Method Details
-
getWrongWords
- Specified by:
getWrongWordsin classAbstractSimpleReplaceRule
-
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 classAbstractSimpleReplaceRule
-
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 classAbstractSimpleReplaceRule
-
getShort
- Overrides:
getShortin classAbstractSimpleReplaceRule
-
getMessage
- Overrides:
getMessagein classAbstractSimpleReplaceRule
-
isTagged
Description copied from class:AbstractSimpleReplaceRuleThis method allows to override which tags will mark token as tagged- Overrides:
isTaggedin classAbstractSimpleReplaceRule- Returns:
- returns true if token has valid tag
-
findMatches
protected List<RuleMatch> findMatches(AnalyzedTokenReadings tokenReadings, AnalyzedSentence sentence) throws IOException - Overrides:
findMatchesin classAbstractSimpleReplaceRule- Throws:
IOException
-
findInDeriv
-
isGoodPosTag
-
isCaseSensitive
public boolean isCaseSensitive()Description copied from class:AbstractSimpleReplaceRuleIndicates if the rule is case-sensitive. Default value istrue.- Overrides:
isCaseSensitivein classAbstractSimpleReplaceRule- Returns:
- true if the rule is case-sensitive, false otherwise.
-