public class ProhibitedCompoundRule extends Rule
| Modifier and Type | Class and Description |
|---|---|
static class |
ProhibitedCompoundRule.Pair |
| Modifier and Type | Field and Description |
|---|---|
protected com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String> |
ahoCorasickDoubleArrayTrie |
static GermanyGerman |
german |
protected Map<String,List<ProhibitedCompoundRule.Pair>> |
pairMap |
static String |
RULE_ID |
| Constructor and Description |
|---|
ProhibitedCompoundRule(ResourceBundle messages,
LanguageModel lm,
UserConfig userConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addItemsFromConfusionSets(List<ProhibitedCompoundRule.Pair> pairs,
String confusionSetsFile,
boolean isUpperCase) |
String |
getDescription() |
String |
getId() |
RuleMatch[] |
match(AnalyzedSentence sentence) |
void |
setConfusionPair(ProhibitedCompoundRule.Pair confusionPair)
ignore automatically loaded pairs and only match using given confusionPair
used for evaluation by ProhibitedCompoundRuleEvaluator
|
protected static com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String> |
setupAhoCorasickSearch(List<ProhibitedCompoundRule.Pair> pairs,
Map<String,List<ProhibitedCompoundRule.Pair>> pairMap) |
addExamplePair, estimateContextForSureMatch, getAntiPatterns, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getErrorTriggeringExamples, getFullId, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getSentenceWithImmunization, getUrl, hasConfigurableValue, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isOfficeDefaultOff, isOfficeDefaultOn, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setErrorTriggeringExamples, setExamplePair, setIncorrectExamples, setLocQualityIssueType, setOfficeDefaultOff, setOfficeDefaultOn, setUrl, supportsLanguage, toRuleMatchArray, useInOfficepublic static final String RULE_ID
public static final GermanyGerman german
protected com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String> ahoCorasickDoubleArrayTrie
protected Map<String,List<ProhibitedCompoundRule.Pair>> pairMap
public ProhibitedCompoundRule(ResourceBundle messages, LanguageModel lm, UserConfig userConfig)
protected static void addItemsFromConfusionSets(List<ProhibitedCompoundRule.Pair> pairs, String confusionSetsFile, boolean isUpperCase)
protected static com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String> setupAhoCorasickSearch(List<ProhibitedCompoundRule.Pair> pairs, Map<String,List<ProhibitedCompoundRule.Pair>> pairMap)
public String getDescription()
getDescription in class Rulepublic RuleMatch[] match(AnalyzedSentence sentence) throws IOException
match in class RuleIOExceptionpublic void setConfusionPair(ProhibitedCompoundRule.Pair confusionPair)
confusionPair - pair to evaluate, parts are assumed to be lowercase / null to reset