Class BitextPatternRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.bitext.BitextRule
org.languagetool.rules.patterns.bitext.BitextPatternRule
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 the
Rule.match(org.languagetool.AnalyzedSentence) method. It uses the syntax
of XML files similar to normal PatternRules.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AbstractPatternRuleprivate final AbstractPatternRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA short description of the error this rule can detect, usually in the language of the text that is checked.getId()A string used to identify the rule in e.g.match(AnalyzedSentence sentence) This method always returns an empty array.match(AnalyzedSentence sourceSentence, AnalyzedSentence targetSentence) Methods inherited from class org.languagetool.rules.bitext.BitextRule
getCorrectBitextExamples, getIncorrectBitextExamples, getRelevantRules, getSourceLanguage, setCorrectBitextExamples, setIncorrectBitextExamples, setSourceLanguageMethods 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
-
srcRule
-
trgRule
-
-
Constructor Details
-
BitextPatternRule
BitextPatternRule(AbstractPatternRule src, AbstractPatternRule trg)
-
-
Method Details
-
getSrcRule
-
getTrgRule
-
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
- Specified by:
getMessagein classBitextRule
-
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
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:
IOException
-
match
public RuleMatch[] match(AnalyzedSentence sourceSentence, AnalyzedSentence targetSentence) throws IOException - Specified by:
matchin classBitextRule- Throws:
IOException
-