@Experimental public class SymSpellRule extends SpellingCheckRule
Modifier and Type | Field and Description |
---|---|
protected SymSpell |
defaultDictSpeller |
static int |
INITIAL_CAPACITY |
protected SymSpell |
userDictSpeller |
CUSTOM_SPELLING_FILE, GLOBAL_SPELLING_FILE, HIGH_CONFIDENCE, ignoreWordsWithLength, language, languageModel, LANGUAGETOOL, LANGUAGETOOLER, MAX_TOKEN_LENGTH, wordListLoader, wordsToBeIgnored
Constructor and Description |
---|
SymSpellRule(ResourceBundle messages,
Language language,
UserConfig userConfig) |
SymSpellRule(ResourceBundle messages,
Language language,
UserConfig userConfig,
List<Language> altLanguages) |
SymSpellRule(ResourceBundle messages,
Language language,
UserConfig userConfig,
List<Language> altLanguages,
LanguageModel languageModel) |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
A short description of the error this rule can detect, usually in the language of the text
that is checked.
|
String |
getId()
A string used to identify the rule in e.g. configuration files.
|
protected static String |
getSpellingDictBaseDir(Language lang) |
protected static SymSpell |
initDefaultDictSpeller(Language lang) |
protected static SymSpell |
initUserDictSpeller(UserConfig config) |
boolean |
isMisspelled(String word) |
static void |
main(String[] args) |
RuleMatch[] |
match(AnalyzedSentence sentence)
Check whether the given sentence matches this error rule, i.e. whether it
contains the error detected by this rule.
|
acceptPhrases, addIgnoreTokens, addIgnoreWords, addProhibitedWords, addSuggestionsToRuleMatch, createWrongSplitMatch, expandLine, filterDupes, filterNoSuggestWords, filterSuggestions, getAdditionalProhibitFileNames, getAdditionalSpellingFileNames, getAdditionalSuggestions, getAdditionalTopSuggestions, getAntiPatterns, getIgnoreFileName, getLanguageVariantSpellingFileName, getOnlySuggestions, getProhibitFileName, getSpellingFileName, ignorePotentiallyMisspelledWord, ignoreToken, ignoreWord, ignoreWord, init, isDictionaryBasedSpellingRule, isEMail, isIgnoredNoCase, isInIgnoredSet, isLatinScript, isProhibited, isUrl, setConsiderIgnoreWords, setConvertsCase, startsWithIgnoredWord, tokenizeNewWords
addExamplePair, addTags, addToneTags, cacheAntiPatterns, estimateContextForSureMatch, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getDistanceTokens, getErrorTriggeringExamples, getFullId, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getMinPrevMatches, getSentenceWithImmunization, getSourceFile, getSubId, getTags, getToneTags, getUrl, hasConfigurableValue, hasTag, hasToneTag, isDefaultOff, isDefaultTempOff, isGoalSpecific, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setGoalSpecific, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setTags, setToneTags, setUrl, supportsLanguage, toRuleMatchArray, useInOffice
public static final int INITIAL_CAPACITY
protected final SymSpell defaultDictSpeller
protected final SymSpell userDictSpeller
public SymSpellRule(ResourceBundle messages, Language language, UserConfig userConfig)
public SymSpellRule(ResourceBundle messages, Language language, UserConfig userConfig, List<Language> altLanguages)
public SymSpellRule(ResourceBundle messages, Language language, UserConfig userConfig, List<Language> altLanguages, @Nullable LanguageModel languageModel)
@Nullable protected static SymSpell initUserDictSpeller(UserConfig config)
public String getId()
Rule
A-Z
and the underscore.getId
in class SpellingCheckRule
public String getDescription()
Rule
getDescription
in class SpellingCheckRule
public RuleMatch[] match(AnalyzedSentence sentence) throws IOException
Rule
match
in class SpellingCheckRule
sentence
- a pre-analyzed sentenceRuleMatch
objectsIOException
public boolean isMisspelled(String word)
isMisspelled
in class SpellingCheckRule
public static void main(String[] args) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException