Package org.languagetool.rules.de
Class ProhibitedCompoundRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.de.ProhibitedCompoundRule
Find compounds that might be morphologically correct but are still probably wrong, like 'Lehrzeile'.
- Since:
- 4.1
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProhibitedCompoundRule(ResourceBundle messages, LanguageModel lm, UserConfig userConfig, Language language) -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddItemsFromConfusionSets(List<ProhibitedCompoundRule.Pair> pairs, String confusionSetsFile, boolean isUpperCase) getId()match(AnalyzedSentence sentence) voidsetConfusionPair(ProhibitedCompoundRule.Pair confusionPair) ignore automatically loaded pairs and only match using given confusionPair used for evaluation by ProhibitedCompoundRuleEvaluatorprotected static com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String>setupAhoCorasickSearch(List<ProhibitedCompoundRule.Pair> pairs, Map<String, List<ProhibitedCompoundRule.Pair>> pairMap) Methods 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
-
RULE_ID
Deprecated.each pair has its own id since LT 5.1- Since:
- 4.3
- See Also:
-
ahoCorasickDoubleArrayTrie
-
pairMap
-
-
Constructor Details
-
ProhibitedCompoundRule
public ProhibitedCompoundRule(ResourceBundle messages, LanguageModel lm, UserConfig userConfig, Language language)
-
-
Method Details
-
addItemsFromConfusionSets
protected static void addItemsFromConfusionSets(List<ProhibitedCompoundRule.Pair> pairs, String confusionSetsFile, boolean isUpperCase) -
setupAhoCorasickSearch
protected static com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String> setupAhoCorasickSearch(List<ProhibitedCompoundRule.Pair> pairs, Map<String, List<ProhibitedCompoundRule.Pair>> pairMap) -
getId
-
getDescription
- Specified by:
getDescriptionin classRule
-
match
- Specified by:
matchin classRule- Throws:
IOException
-
setConfusionPair
ignore automatically loaded pairs and only match using given confusionPair used for evaluation by ProhibitedCompoundRuleEvaluator- Parameters:
confusionPair- pair to evaluate, parts are assumed to be lowercase / null to reset
-