public abstract class AbstractEnglishSpellerRule extends MorfologikSpellerRule
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<String>> |
topSuggestions |
protected Map<String,List<String>> |
topSuggestionsIgnoreCase |
conversionLocale, globalConfig, motherTongue, speller1, speller2, speller3
CUSTOM_SPELLING_FILE, GLOBAL_SPELLING_FILE, HIGH_CONFIDENCE, ignoreWordsWithLength, language, languageModel, LANGUAGETOOL, LANGUAGETOOLER, MAX_TOKEN_LENGTH, wordListLoader, wordsToBeIgnored
Constructor and Description |
---|
AbstractEnglishSpellerRule(ResourceBundle messages,
Language language) |
AbstractEnglishSpellerRule(ResourceBundle messages,
Language language,
GlobalConfig globalConfig,
UserConfig userConfig,
List<Language> altLanguages,
LanguageModel languageModel,
Language motherTongue) |
AbstractEnglishSpellerRule(ResourceBundle messages,
Language language,
UserConfig userConfig,
List<Language> altLanguages) |
Modifier and Type | Method and Description |
---|---|
protected List<SuggestedReplacement> |
filterNoSuggestWords(List<SuggestedReplacement> l) |
protected List<SuggestedReplacement> |
filterSuggestions(List<SuggestedReplacement> suggestions)
Remove prohibited words from suggestions.
|
protected List<SuggestedReplacement> |
getAdditionalTopSuggestions(List<SuggestedReplacement> suggestions,
String word)
Get additional suggestions added before other suggestions (note the rule may choose to
re-order the suggestions anyway).
|
protected List<SuggestedReplacement> |
getOnlySuggestions(String word)
Get suggestions that will replace all other suggestions.
|
protected List<RuleMatch> |
getRuleMatches(String word,
int startPos,
AnalyzedSentence sentence,
List<RuleMatch> ruleMatchesSoFar,
int idx,
AnalyzedTokenReadings[] tokens) |
protected static Map<String,List<String>> |
getTopSuggestions() |
protected static Map<String,List<String>> |
getTopSuggestionsIgnoreCase() |
protected Translator |
getTranslator(GlobalConfig globalConfig) |
protected org.languagetool.rules.en.VariantInfo |
isValidInOtherVariant(String word) |
protected static Map<String,String> |
loadWordlist(String path,
int column) |
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 boolean |
tokenizeNewWords() |
getDescription, getFileName, getId, getSpellingSuggestions, ignoreWord, isEmoji, isMisspelled, isMisspelled, orderSuggestions, setCheckCompound, setCompoundRegex, setIgnoreTaggedWords, setLocale, tokenizingPattern
acceptPhrases, addIgnoreTokens, addIgnoreWords, addProhibitedWords, addSuggestionsToRuleMatch, createWrongSplitMatch, expandLine, filterDupes, getAdditionalProhibitFileNames, getAdditionalSpellingFileNames, getAdditionalSuggestions, getAntiPatterns, getIgnoreFileName, getLanguageVariantSpellingFileName, getProhibitFileName, getSpellingFileName, ignorePotentiallyMisspelledWord, ignoreToken, ignoreWord, init, isDictionaryBasedSpellingRule, isEMail, isIgnoredNoCase, isInIgnoredSet, isLatinScript, isProhibited, isUrl, setConsiderIgnoreWords, setConvertsCase, startsWithIgnoredWord
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 AbstractEnglishSpellerRule(ResourceBundle messages, Language language) throws IOException
IOException
public AbstractEnglishSpellerRule(ResourceBundle messages, Language language, UserConfig userConfig, List<Language> altLanguages) throws IOException
IOException
public AbstractEnglishSpellerRule(ResourceBundle messages, Language language, GlobalConfig globalConfig, UserConfig userConfig, List<Language> altLanguages, LanguageModel languageModel, Language motherTongue) throws IOException
IOException
public RuleMatch[] match(AnalyzedSentence sentence) throws IOException
Rule
match
in class MorfologikSpellerRule
sentence
- a pre-analyzed sentenceRuleMatch
objectsIOException
protected List<SuggestedReplacement> filterNoSuggestWords(List<SuggestedReplacement> l)
filterNoSuggestWords
in class SpellingCheckRule
protected List<SuggestedReplacement> filterSuggestions(List<SuggestedReplacement> suggestions)
SpellingCheckRule
filterSuggestions
in class SpellingCheckRule
protected List<RuleMatch> getRuleMatches(String word, int startPos, AnalyzedSentence sentence, List<RuleMatch> ruleMatchesSoFar, int idx, AnalyzedTokenReadings[] tokens) throws IOException
getRuleMatches
in class MorfologikSpellerRule
IOException
@Nullable protected org.languagetool.rules.en.VariantInfo isValidInOtherVariant(String word)
protected List<SuggestedReplacement> getAdditionalTopSuggestions(List<SuggestedReplacement> suggestions, String word) throws IOException
SpellingCheckRule
getAdditionalTopSuggestions
in class SpellingCheckRule
IOException
protected Translator getTranslator(GlobalConfig globalConfig)
getTranslator
in class MorfologikSpellerRule
protected boolean tokenizeNewWords()
tokenizeNewWords
in class SpellingCheckRule
protected List<SuggestedReplacement> getOnlySuggestions(String word)
SpellingCheckRule
getOnlySuggestions
in class SpellingCheckRule