Package org.languagetool.rules.br
Class TopoReplaceRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.br.TopoReplaceRule
public class TopoReplaceRule
extends org.languagetool.rules.Rule
A rule that matches place names in French which should be
translated in Breton.
Loads the list of words from
rules/br/topo.txt
.
This class is mostly copied from ro/SimpleReplaceRules.java.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Locale
static final String
private static final String
private static final String
Fields inherited from class org.languagetool.rules.Rule
messages
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addToQueue
(org.languagetool.AnalyzedTokenReadings token, Queue<org.languagetool.AnalyzedTokenReadings> prevTokens) final String
getId()
locale used on case-conversiongetShort()
boolean
loadWords
(InputStream stream) Load the list of words.org.languagetool.rules.RuleMatch[]
match
(org.languagetool.AnalyzedSentence sentence) Methods inherited from class org.languagetool.rules.Rule
addExamplePair, estimateContextForSureMatch, getAntiPatterns, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getErrorTriggeringExamples, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getSentenceWithImmunization, getUrl, hasConfigurableValue, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isOfficeDefaultOff, isOfficeDefaultOn, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setErrorTriggeringExamples, setIncorrectExamples, setLocQualityIssueType, setOfficeDefaultOff, setOfficeDefaultOn, setUrl, supportsLanguage, toRuleMatchArray, useInOffice
-
Field Details
-
BRETON_TOPO
- See Also:
-
FILE_NAME
- See Also:
-
FILE_ENCODING
- See Also:
-
BR_LOCALE
-
wrongWords
-
-
Constructor Details
-
TopoReplaceRule
-
-
Method Details
-
getId
- Specified by:
getId
in classorg.languagetool.rules.Rule
-
getDescription
- Specified by:
getDescription
in classorg.languagetool.rules.Rule
-
getShort
-
getSuggestion
-
getSuggestionsSeparator
- Returns:
- the word used to separate multiple suggestions; used only before last suggestion, the rest are comma-separated.
-
isCaseSensitive
public boolean isCaseSensitive() -
getLocale
locale used on case-conversion -
getWrongWords
- Returns:
- the list of wrong words for which this rule can suggest correction. The list cannot be modified.
-
loadWords
Load the list of words. Same asAbstractSimpleReplaceRule.loadFromPath(java.lang.String)
but allows multiple words.- Parameters:
stream
- the stream to load.- Returns:
- the list of maps containing the error-corrections pairs. The n-th map contains key strings of (n+1) words.
-
addToQueue
private void addToQueue(org.languagetool.AnalyzedTokenReadings token, Queue<org.languagetool.AnalyzedTokenReadings> prevTokens) -
match
public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence sentence) - Specified by:
match
in classorg.languagetool.rules.Rule
-