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.- Author:
- Marcin MiĆkowski
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
A short description of the error this rule can detect, usually in the language of the text that is checked.String
getId()
A string used to identify the rule in e.g.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
-
-
-
-
Method Detail
-
getSrcRule
public AbstractPatternRule getSrcRule()
-
getTrgRule
public AbstractPatternRule getTrgRule()
-
getDescription
public 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 String getMessage()
- Specified by:
getMessage
in classBitextRule
-
getId
public 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 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:
IOException
-
match
public RuleMatch[] match(AnalyzedSentence sourceSentence, AnalyzedSentence targetSentence) throws IOException
- Specified by:
match
in classBitextRule
- Throws:
IOException
-
-