Class ProhibitedCompoundRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.de.ProhibitedCompoundRule
public class ProhibitedCompoundRule
extends org.languagetool.rules.Rule
Find compounds that might be morphologically correct but are still probably wrong, like 'Lehrzeile'.
- Since:
- 4.1
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String> protected Map<String, List<ProhibitedCompoundRule.Pair>> static final StringFields inherited from class org.languagetool.rules.Rule
messages -
Constructor Summary
ConstructorsConstructorDescriptionProhibitedCompoundRule(ResourceBundle messages, org.languagetool.languagemodel.LanguageModel lm) -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddItemsFromConfusionSets(List<ProhibitedCompoundRule.Pair> pairs, String confusionSetsFile, boolean isUpperCase) getId()org.languagetool.rules.RuleMatch[]match(org.languagetool.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, estimateContextForSureMatch, getAntiPatterns, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getErrorTriggeringExamples, 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
-
Field Details
-
RULE_ID
- Since:
- 4.3
- See Also:
-
ahoCorasickDoubleArrayTrie
-
pairMap
-
-
Constructor Details
-
ProhibitedCompoundRule
public ProhibitedCompoundRule(ResourceBundle messages, org.languagetool.languagemodel.LanguageModel lm)
-
-
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
- Specified by:
getIdin classorg.languagetool.rules.Rule
-
getDescription
- Specified by:
getDescriptionin classorg.languagetool.rules.Rule
-
match
public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence sentence) throws IOException - Specified by:
matchin classorg.languagetool.rules.Rule- 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
-