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