public abstract class BitextRule extends Rule
Rule.match(org.languagetool.AnalyzedSentence) method.| Constructor and Description |
|---|
BitextRule() |
| Modifier and Type | Method and Description |
|---|---|
List<StringPair> |
getCorrectBitextExamples()
Get example sentences that are correct and thus will not match this rule.
|
abstract String |
getDescription()
A short description of the error this rule can detect, usually in the language of the text
that is checked.
|
abstract String |
getId()
A string used to identify the rule in e.g. configuration files.
|
List<IncorrectBitextExample> |
getIncorrectBitextExamples()
Get example sentences that are incorrect and thus will match this rule.
|
abstract String |
getMessage() |
protected String |
getPureText(AnalyzedSentence sentence) |
static List<Class<? extends BitextRule>> |
getRelevantRules() |
Language |
getSourceLanguage() |
RuleMatch[] |
match(AnalyzedSentence sentence)
This method makes no sense for bitext, thus it always returns
null. |
abstract RuleMatch[] |
match(AnalyzedSentence sourceText,
AnalyzedSentence targetText) |
abstract void |
reset()
If a rule keeps its state over more than the check of one sentence, this
must be implemented so the internal state is reset.
|
void |
setCorrectBitextExamples(List<StringPair> correctExamples)
Set the examples that are correct and thus do not trigger the rule.
|
void |
setIncorrectBitextExamples(List<IncorrectBitextExample> incorrectExamples)
Set the examples that are incorrect and thus do trigger the rule.
|
void |
setSourceLanguage(Language lang)
Set the source language.
|
addExamplePair, getCategory, getCorrectExamples, getIncorrectExamples, getLocQualityIssueType, getUrl, isDefaultOff, isDictionaryBasedSpellingRule, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setIncorrectExamples, setLocQualityIssueType, setUrl, supportsLanguage, toRuleMatchArray, useInOfficepublic static List<Class<? extends BitextRule>> getRelevantRules()
public abstract String getDescription()
RulegetDescription in class Rulepublic abstract String getId()
RuleA-Z
and the underscore.public abstract void reset()
Rulepublic abstract String getMessage()
public abstract RuleMatch[] match(AnalyzedSentence sourceText, AnalyzedSentence targetText) throws IOException
IOException@Nullable public RuleMatch[] match(AnalyzedSentence sentence) throws IOException
null.match in class Rulesentence - a pre-analyzed sentenceRuleMatch objectsIOExceptionpublic final void setSourceLanguage(Language lang)
lang - Source Languagepublic final Language getSourceLanguage()
public final void setCorrectBitextExamples(List<StringPair> correctExamples)
public final List<StringPair> getCorrectBitextExamples()
public final void setIncorrectBitextExamples(List<IncorrectBitextExample> incorrectExamples)
public final List<IncorrectBitextExample> getIncorrectBitextExamples()
protected String getPureText(AnalyzedSentence sentence)