org.languagetool.rules.bitext
Class DifferentLengthRule

Object
  extended by Rule
      extended by BitextRule
          extended by 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%).

Author:
Marcin MiƂkowski

Constructor Summary
DifferentLengthRule()
           
 
Method Summary
 String getDescription()
           
 String getId()
          An ASCII-only string used to identify the rule in e.g. configuration files.
 String getMessage()
           
 RuleMatch[] match(AnalyzedSentence sourceText, AnalyzedSentence targetText)
           
 void reset()
          If a rule keeps its state over more than the check of one sentence, this must be implemented so the internal state is reset.
 
Methods inherited from class BitextRule
getCorrectBitextExamples, getIncorrectBitextExamples, getRelevantRules, getSourceLang, match, setCorrectBitextExamples, setIncorrectBitextExamples, setSourceLang
 
Methods inherited from class Rule
addRuleMatch, clearMatches, getCategory, getCorrectExamples, getIncorrectExamples, getMatches, getMatchesIndex, isDefaultOff, isInMatches, isInRemoved, isParagraphBackTrack, setAsDeleted, setCategory, setCorrectExamples, setDefaultOff, setIncorrectExamples, setParagraphBackTrack, supportsLanguage
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DifferentLengthRule

public DifferentLengthRule()
Method Detail

getDescription

public String getDescription()
Specified by:
getDescription in class BitextRule

getId

public String getId()
Description copied from class: Rule
An ASCII-only 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.

Specified by:
getId in class BitextRule

getMessage

public String getMessage()
Specified by:
getMessage in class BitextRule

match

public RuleMatch[] match(AnalyzedSentence sourceText,
                         AnalyzedSentence targetText)
                  throws IOException
Specified by:
match in class BitextRule
Throws:
IOException

reset

public void reset()
Description copied from class: Rule
If a rule keeps its state over more than the check of one sentence, this must be implemented so the internal state is reset. It will be called before a new text is going to be checked.

Specified by:
reset in class BitextRule


Copyright © 2005-2011 Daniel Naber