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 Localestatic final Stringprivate static final Stringprivate static final StringFields inherited from class org.languagetool.rules.Rule
messages -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToQueue(org.languagetool.AnalyzedTokenReadings token, Queue<org.languagetool.AnalyzedTokenReadings> prevTokens) final StringgetId()locale used on case-conversiongetShort()booleanloadWords(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:
getIdin classorg.languagetool.rules.Rule
-
getDescription
- Specified by:
getDescriptionin 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
-
loadWords
Load the list of words. Same asAbstractSimpleReplaceRule.loadFromPath(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:
matchin classorg.languagetool.rules.Rule
-