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 AbstractPatternRule
srcRule
private AbstractPatternRule
trgRule
-
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.String
getDescription()
A short description of the error this rule can detect, usually in the language of the text that is checked.java.lang.String
getId()
A string used to identify the rule in e.g.java.lang.String
getMessage()
AbstractPatternRule
getSrcRule()
AbstractPatternRule
getTrgRule()
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:Rule
A short description of the error this rule can detect, usually in the language of the text that is checked.- Specified by:
getDescription
in classRule
-
getMessage
public java.lang.String getMessage()
- Specified by:
getMessage
in classBitextRule
-
getId
public java.lang.String getId()
Description copied from class:Rule
A 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-Z
and 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:
match
in classBitextRule
- Parameters:
sentence
- a pre-analyzed sentence- Returns:
- an array of
RuleMatch
objects - Throws:
java.io.IOException
-
match
public RuleMatch[] match(AnalyzedSentence sourceSentence, AnalyzedSentence targetSentence) throws java.io.IOException
- Specified by:
match
in classBitextRule
- Throws:
java.io.IOException
-
-