public abstract class MorfologikSpellerRule extends SpellingCheckRule
| Modifier and Type | Field and Description |
|---|---|
protected Locale |
conversionLocale |
protected MorfologikMultiSpeller |
speller1 |
protected MorfologikMultiSpeller |
speller2 |
language, LANGUAGETOOL, LANGUAGETOOL_FX| Constructor and Description |
|---|
MorfologikSpellerRule(ResourceBundle messages,
Language language) |
| 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.
|
abstract String |
getFileName()
Get the filename, e.g., /resource/pl/spelling.dict.
|
abstract String |
getId()
A string used to identify the rule in e.g. configuration files.
|
protected List<RuleMatch> |
getRuleMatches(String word,
int startPos) |
protected boolean |
isMisspelled(MorfologikMultiSpeller speller,
String word) |
RuleMatch[] |
match(AnalyzedSentence sentence)
Check whether the given sentence matches this error rule, i.e. whether it
contains the error detected by this rule.
|
protected List<String> |
orderSuggestions(List<String> suggestions,
String word) |
protected void |
setCheckCompound(boolean checkCompound) |
protected void |
setCompoundRegex(String compoundRegex) |
void |
setIgnoreTaggedWords()
Skip words that are known in the POS tagging dictionary, assuming they
cannot be incorrect.
|
void |
setLocale(Locale locale) |
Pattern |
tokenizingPattern()
Get the regular expression pattern used to tokenize
the words as in the source dictionary.
|
addIgnoreTokens, addIgnoreWords, expandLine, filterSuggestions, getAdditionalSuggestions, getAdditionalTopSuggestions, getIgnoreFileName, getProhibitFileName, getSpellingFileName, ignoreToken, ignoreWord, ignoreWord, init, isConvertsCase, isDictionaryBasedSpellingRule, isProhibited, isUrl, reset, setConsiderIgnoreWords, setConvertsCaseaddExamplePair, getCategory, getCorrectExamples, getIncorrectExamples, getLocQualityIssueType, getUrl, isDefaultOff, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setIncorrectExamples, setLocQualityIssueType, setUrl, supportsLanguage, toRuleMatchArray, useInOfficeprotected MorfologikMultiSpeller speller1
protected MorfologikMultiSpeller speller2
protected Locale conversionLocale
public MorfologikSpellerRule(ResourceBundle messages, Language language) throws IOException
IOExceptionpublic abstract String getFileName()
public abstract String getId()
RuleA-Z
and the underscore.getId in class SpellingCheckRulepublic String getDescription()
RulegetDescription in class SpellingCheckRulepublic void setLocale(Locale locale)
public void setIgnoreTaggedWords()
public RuleMatch[] match(AnalyzedSentence sentence) throws IOException
Rulematch in class SpellingCheckRulesentence - a pre-analyzed sentenceRuleMatch objectsIOExceptionprotected boolean isMisspelled(MorfologikMultiSpeller speller, String word)
protected List<RuleMatch> getRuleMatches(String word, int startPos) throws IOException
IOException@Nullable public Pattern tokenizingPattern()
Pattern that is used to tokenize words or null.protected void setCheckCompound(boolean checkCompound)
checkCompound - If true and the word is not in the dictionary
it will be split (see setCompoundRegex(String))
and each component will be checked separatelyprotected void setCompoundRegex(String compoundRegex)
compoundRegex - see setCheckCompound(boolean)