|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectRule
BitextRule
public abstract class BitextRule
Abstract bitext rule class. A BitextRule describes a language error and
can test whether a given pre-analyzed pair of source and target text
contains that error using the Rule.match(org.languagetool.AnalyzedSentence) method.
| Constructor Summary | |
|---|---|
BitextRule()
|
|
| Method Summary | |
|---|---|
List<StringPair> |
getCorrectBitextExamples()
Get example sentences that are correct and thus will not match this rule. |
abstract String |
getDescription()
|
abstract String |
getId()
An ASCII-only 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()
|
static List<Class<? extends BitextRule>> |
getRelevantRules()
|
Language |
getSourceLang()
|
RuleMatch[] |
match(AnalyzedSentence text)
This method makes no sense for bitext, return 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 |
setSourceLang(Language lang)
Set the source language. |
| Methods inherited from class Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BitextRule()
| Method Detail |
|---|
public static List<Class<? extends BitextRule>> getRelevantRules()
public abstract String getDescription()
getDescription in class Rulepublic abstract String getMessage()
public abstract String getId()
Rule
getId in class Rule
public abstract RuleMatch[] match(AnalyzedSentence sourceText,
AnalyzedSentence targetText)
throws IOException
IOExceptionpublic abstract void reset()
Rule
reset in class Rule
public RuleMatch[] match(AnalyzedSentence text)
throws IOException
match in class Ruletext - a pre-analyzed sentence
IOExceptionpublic final void setSourceLang(Language lang)
lang - - Source Languagepublic final Language getSourceLang()
public final void setCorrectBitextExamples(List<StringPair> correctExamples)
public final List<StringPair> getCorrectBitextExamples()
public final void setIncorrectBitextExamples(List<IncorrectBitextExample> incorrectExamples)
public final List<IncorrectBitextExample> getIncorrectBitextExamples()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||