Class BitextPatternRule
- java.lang.Object
-
- org.languagetool.rules.Rule
-
- org.languagetool.rules.bitext.BitextRule
-
- org.languagetool.rules.patterns.bitext.BitextPatternRule
-
public class BitextPatternRule extends BitextRule
A bitext pattern rule class. A BitextPatternRule describes a language error and can test whether a given pre-analyzed pair of source and target text contains that error using theRule.match(org.languagetool.AnalyzedSentence)method. It uses the syntax of XML files similar to normal PatternRules.
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractPatternRulesrcRuleprivate AbstractPatternRuletrgRule
-
Constructor Summary
Constructors Constructor Description BitextPatternRule(AbstractPatternRule src, AbstractPatternRule trg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescription()A short description of the error this rule can detect, usually in the language of the text that is checked.java.lang.StringgetId()A string used to identify the rule in e.g.java.lang.StringgetMessage()AbstractPatternRulegetSrcRule()AbstractPatternRulegetTrgRule()RuleMatch[]match(AnalyzedSentence sentence)This method always returns an empty array.RuleMatch[]match(AnalyzedSentence sourceSentence, AnalyzedSentence targetSentence)-
Methods inherited from class org.languagetool.rules.bitext.BitextRule
getCorrectBitextExamples, getIncorrectBitextExamples, getRelevantRules, getSourceLanguage, setCorrectBitextExamples, setIncorrectBitextExamples, setSourceLanguage
-
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 Detail
-
srcRule
private final AbstractPatternRule srcRule
-
trgRule
private final AbstractPatternRule trgRule
-
-
Constructor Detail
-
BitextPatternRule
BitextPatternRule(AbstractPatternRule src, AbstractPatternRule trg)
-
-
Method Detail
-
getSrcRule
public AbstractPatternRule getSrcRule()
-
getTrgRule
public AbstractPatternRule getTrgRule()
-
getDescription
public java.lang.String getDescription()
Description copied from class:RuleA short description of the error this rule can detect, usually in the language of the text that is checked.- Specified by:
getDescriptionin classRule
-
getMessage
public java.lang.String getMessage()
- Specified by:
getMessagein classBitextRule
-
getId
public java.lang.String 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.
-
match
public RuleMatch[] match(AnalyzedSentence sentence) throws java.io.IOException
This method always returns an empty array. Usematch(org.languagetool.AnalyzedSentence, org.languagetool.AnalyzedSentence)instead.- Overrides:
matchin classBitextRule- Parameters:
sentence- a pre-analyzed sentence- Returns:
- an array of
RuleMatchobjects - Throws:
java.io.IOException
-
match
public RuleMatch[] match(AnalyzedSentence sourceSentence, AnalyzedSentence targetSentence) throws java.io.IOException
- Specified by:
matchin classBitextRule- Throws:
java.io.IOException
-
-