de.danielnaber.languagetool.rules
Class AbstractCompoundRule

Object
  extended by Rule
      extended by AbstractCompoundRule
Direct Known Subclasses:
CompoundRule, CompoundRule, CompoundRule, CompoundRule, RussianCompoundRule

public abstract class AbstractCompoundRule
extends Rule

Checks that compounds (if in the list) are not written as separate words.

Author:
Daniel Naber & Marcin MiƂkowski (refactoring)

Constructor Summary
AbstractCompoundRule(ResourceBundle messages)
           
 
Method Summary
abstract  String getDescription()
           
abstract  String getId()
           
 void loadCompoundFile(InputStream file, String encoding)
           
 RuleMatch[] match(AnalyzedSentence text)
          Check whether the given text matches this error rule, i.e. whether the text contains this error.
 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.
 void setMsg(String msg1, String msg2, String msg3)
           
 void setShort(String shortDescription)
           
 
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

AbstractCompoundRule

public AbstractCompoundRule(ResourceBundle messages)
                     throws IOException
Throws:
IOException
Method Detail

getId

public abstract String getId()
Specified by:
getId in class Rule

getDescription

public abstract String getDescription()
Specified by:
getDescription in class Rule

setShort

public void setShort(String shortDescription)

setMsg

public void setMsg(String msg1,
                   String msg2,
                   String msg3)

match

public RuleMatch[] match(AnalyzedSentence text)
Description copied from class: Rule
Check whether the given text matches this error rule, i.e. whether the text contains this error.

Specified by:
match in class Rule
Parameters:
text - a pre-analyzed sentence
Returns:
an array of RuleMatch object for each match.

loadCompoundFile

public void loadCompoundFile(InputStream file,
                             String encoding)
                      throws IOException
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 Rule


Copyright © 2005-2009 Daniel Naber