Package org.languagetool.rules.pt
Class MorfologikPortugueseSpellerRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.spelling.SpellingCheckRule
org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
org.languagetool.rules.pt.MorfologikPortugueseSpellerRule
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate final Stringprivate static final Stringprivate static final Stringprivate final Languageprivate static final Stringprivate static final Stringprivate static final Stringprivate static final PortugueseSynthesizerprivate static final PortugueseTaggerFields inherited from class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
conversionLocale, globalConfig, motherTongue, speller1, speller2, speller3Fields inherited from class org.languagetool.rules.spelling.SpellingCheckRule
CUSTOM_SPELLING_FILE, GLOBAL_SPELLING_FILE, HIGH_CONFIDENCE, ignoreWordsWithLength, language, languageModel, LANGUAGETOOL, LANGUAGETOOLER, MAX_TOKEN_LENGTH, wordListLoader, wordsToBeIgnored -
Constructor Summary
ConstructorsConstructorDescriptionMorfologikPortugueseSpellerRule(ResourceBundle messages, Language language, UserConfig userConfig, List<Language> altLanguages) -
Method Summary
Modifier and TypeMethodDescriptionprivate StringcheckCompoundElements(String[] wordParts) private StringcheckDiaeresis(String word) private Stringprotected StringdialectAlternative(String word) protected List<SuggestedReplacement> filterNoSuggestWords(List<SuggestedReplacement> suggestedReplacements) Get the name of additional spelling file, which lists words to be accepted and used for suggestions, even when the spell checker would not accept them.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).getAdditionalTopSuggestionsString(List<String> suggestions, String word) private StringGet the filename, e.g.,/resource/pl/spelling.dict.getId()A string used to identify the rule in e.g.protected StringGet the name of the ignore file, which lists words to be accepted, even when the spell checker would not accept them.Get the name of the prohibit file, which lists words not to be accepted, even when the spell checker would accept them.getRuleMatches(String word, int startPos, AnalyzedSentence sentence, List<RuleMatch> ruleMatchesSoFar, int idx, AnalyzedTokenReadings[] tokens) getWordSetFromResources(String filepath) protected booleanisAbbreviation(String word) private booleanisTitlecasedHyphenatedWord(String[] wordParts) private booleanisValidCliticVerb(String word) private voidreplaceFormsOfFirstMatch(String message, AnalyzedSentence sentence, List<RuleMatch> ruleMatches, String suggestion, boolean dialectIssue) Methods inherited from class org.languagetool.rules.spelling.morfologik.MorfologikSpellerRule
addHyphenSuggestions, getDescription, getSpellingSuggestions, getTranslator, ignoreWord, isMisspelled, isMisspelled, match, orderSuggestions, setCheckCompound, setCompoundRegex, setIgnoreTaggedWords, setLocale, tokenizingPatternMethods inherited from class org.languagetool.rules.spelling.SpellingCheckRule
acceptPhrases, addIgnoreTokens, addIgnoreWords, addProhibitedWords, addSuggestionsToRuleMatch, createWrongSplitMatch, expandLine, filterDupes, filterSuggestions, getAdditionalProhibitFileNames, getAdditionalSuggestions, getAntiPatterns, getLanguageVariantSpellingFileName, getOnlySuggestions, getSpellingFileName, ignorePotentiallyMisspelledWord, ignoreToken, ignoreWord, init, isDictionaryBasedSpellingRule, isEMail, isIgnoredNoCase, isInIgnoredSet, isLatinScript, isProhibited, isUrl, setConsiderIgnoreWords, setConvertsCase, startsWithIgnoredWord, tokenizeNewWordsMethods inherited from class org.languagetool.rules.Rule
addExamplePair, addTags, addToneTags, cacheAntiPatterns, estimateContextForSureMatch, getCategory, getCorrectExamples, getDistanceTokens, getErrorTriggeringExamples, getFullId, getIncorrectExamples, getLocQualityIssueType, getMinPrevMatches, getPriority, getRuleOptions, getSentenceWithImmunization, getSourceFile, getSubId, getTags, getToneTags, getUrl, hasTag, hasToneTag, isDefaultOff, isDefaultTempOff, isGoalSpecific, isIncludedInHiddenMatches, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setGoalSpecific, setIncludedInHiddenMatches, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setPriority, setTags, setToneTags, setUrl, supportsLanguage, toRuleMatchArray, useInOffice
-
Field Details
-
spellerLanguage
-
dictFilepath
-
doNotSuggestWordsFilepath
- See Also:
-
doNotSuggestWords
-
abbreviationFilepath
- See Also:
-
abbreviations
-
dialectAlternationsFilepath
- See Also:
-
dialectAlternationMapping
-
tagger
-
synth
-
SPELLING_FILE
- See Also:
-
MULTIWORDS_FILE
- See Also:
-
SPELLING_IGNORE_FILE
- See Also:
-
SPELLING_PROHIBIT_FILE
- See Also:
-
-
Constructor Details
-
MorfologikPortugueseSpellerRule
public MorfologikPortugueseSpellerRule(ResourceBundle messages, Language language, UserConfig userConfig, List<Language> altLanguages) throws IOException - Throws:
IOException
-
-
Method Details
-
getFileName
Description copied from class:MorfologikSpellerRuleGet the filename, e.g.,/resource/pl/spelling.dict.- Specified by:
getFileNamein classMorfologikSpellerRule
-
getDoNotSuggestWords
-
getAbbreviations
-
getWordSetFromResources
-
getIgnoreFileName
Description copied from class:SpellingCheckRuleGet the name of the ignore file, which lists words to be accepted, even when the spell checker would not accept them. Unlike withSpellingCheckRule.getSpellingFileName()the words in this file will not be used for creating suggestions for misspelled words.- Overrides:
getIgnoreFileNamein classSpellingCheckRule
-
getProhibitFileName
Description copied from class:SpellingCheckRuleGet the name of the prohibit file, which lists words not to be accepted, even when the spell checker would accept them.- Overrides:
getProhibitFileNamein classSpellingCheckRule
-
getId
Description copied from class:RuleA string used to identify the rule in e.g. configuration files. This string is supposed to be unique and to stay the same in all upcoming versions of LanguageTool. It's supposed to contain only the charactersA-Zand the underscore.- Specified by:
getIdin classMorfologikSpellerRule
-
getIdForDialectIssue
-
dialectAlternative
- Throws:
IOException
-
checkDiaeresis
-
checkEuropeanStyle1PLPastTense
-
isTitlecasedHyphenatedWord
-
checkCompoundElements
-
getDialectAlternationMapping
-
isValidCliticVerb
-
filterNoSuggestWords
protected List<SuggestedReplacement> filterNoSuggestWords(List<SuggestedReplacement> suggestedReplacements) - Overrides:
filterNoSuggestWordsin classSpellingCheckRule
-
getAdditionalTopSuggestions
protected List<SuggestedReplacement> getAdditionalTopSuggestions(List<SuggestedReplacement> suggestions, String word) throws IOException Description copied from class:SpellingCheckRuleGet additional suggestions added before other suggestions (note the rule may choose to re-order the suggestions anyway). Only add suggestions here that you know are spelled correctly, they will not be checked again before being shown to the user.- Overrides:
getAdditionalTopSuggestionsin classSpellingCheckRule- Throws:
IOException
-
getAdditionalTopSuggestionsString
private List<String> getAdditionalTopSuggestionsString(List<String> suggestions, String word) throws IOException - Throws:
IOException
-
isAbbreviation
-
getDictFilename
-
getAdditionalSpellingFileNames
Description copied from class:SpellingCheckRuleGet the name of additional spelling file, which lists words to be accepted and used for suggestions, even when the spell checker would not accept them.- Overrides:
getAdditionalSpellingFileNamesin classSpellingCheckRule
-
replaceFormsOfFirstMatch
private void replaceFormsOfFirstMatch(String message, AnalyzedSentence sentence, List<RuleMatch> ruleMatches, String suggestion, boolean dialectIssue) -
getRuleMatches
public List<RuleMatch> getRuleMatches(String word, int startPos, AnalyzedSentence sentence, List<RuleMatch> ruleMatchesSoFar, int idx, AnalyzedTokenReadings[] tokens) throws IOException - Overrides:
getRuleMatchesin classMorfologikSpellerRule- Throws:
IOException
-