Package org.languagetool.rules.bitext
Class DifferentLengthRule
- java.lang.Object
-
- org.languagetool.rules.Rule
-
- org.languagetool.rules.bitext.BitextRule
-
- org.languagetool.rules.bitext.DifferentLengthRule
-
public class DifferentLengthRule extends BitextRule
Checks if the translation has a really different length than the source (smaller than 30% or longer by 250%).
-
-
Constructor Summary
Constructors Constructor Description DifferentLengthRule()
-
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()
private boolean
isLengthDifferent(java.lang.String src, java.lang.String trg)
RuleMatch[]
match(AnalyzedSentence sourceText, AnalyzedSentence targetText)
-
Methods inherited from class org.languagetool.rules.bitext.BitextRule
getCorrectBitextExamples, getIncorrectBitextExamples, getRelevantRules, getSourceLanguage, match, 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
-
MAX_SKEW
private static final int MAX_SKEW
- See Also:
- Constant Field Values
-
MIN_SKEW
private static final int MIN_SKEW
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
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.
-
getMessage
public java.lang.String getMessage()
- Specified by:
getMessage
in classBitextRule
-
match
public RuleMatch[] match(AnalyzedSentence sourceText, AnalyzedSentence targetText) throws java.io.IOException
- Specified by:
match
in classBitextRule
- Throws:
java.io.IOException
-
isLengthDifferent
private boolean isLengthDifferent(java.lang.String src, java.lang.String trg)
-
-