org.cogroo.tools.checker.checkers
Class GovernmentChecker

java.lang.Object
  extended by org.cogroo.tools.checker.AbstractGenericChecker<Sentence>
      extended by org.cogroo.tools.checker.AbstractChecker
          extended by org.cogroo.tools.checker.checkers.GovernmentChecker
All Implemented Interfaces:
Checker, GenericChecker<Sentence>

public class GovernmentChecker
extends AbstractChecker


Constructor Summary
GovernmentChecker()
           
 
Method Summary
 List<Mistake> check(Sentence sentence)
          Check the sentence for errors.
 List<Token> findNouns(Sentence sentence)
          Looks for a noun in the sentence's objects.
 Token findPrep(Sentence sentence, Token token)
           
 Token findVerb(Sentence sentence)
          Looks in a sentence for a verb.
 String getIdPrefix()
          Each checker should have IDs with a fixed prefix so CheckerComposite can route the ignore message to the correct checker.
 int getPriority()
          Priority of this checker.
 
Methods inherited from class org.cogroo.tools.checker.AbstractGenericChecker
add, getRuleDefinition, getRulesDefinition, ignore, resetIgnored
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cogroo.tools.checker.GenericChecker
getRulesDefinition, ignore, resetIgnored
 

Constructor Detail

GovernmentChecker

public GovernmentChecker()
Method Detail

getIdPrefix

public String getIdPrefix()
Description copied from interface: GenericChecker
Each checker should have IDs with a fixed prefix so CheckerComposite can route the ignore message to the correct checker.

Returns:
the id prefix

getPriority

public int getPriority()
Description copied from interface: GenericChecker
Priority of this checker. The higher is the number the higher is its priority

Returns:
the priority of this checker

check

public List<Mistake> check(Sentence sentence)
Description copied from interface: GenericChecker
Check the sentence for errors.

Parameters:
sentence - the sentence
Returns:
errors

findNouns

public List<Token> findNouns(Sentence sentence)
Looks for a noun in the sentence's objects.

Parameters:
sentence - entered by the user
Returns:
a List> of every noun found in the sentence's objects and its location in the sentence

findVerb

public Token findVerb(Sentence sentence)
Looks in a sentence for a verb.

Parameters:
sentence - entered by the user
Returns:
the Token which contains the searched verb, in case none was found returns null

findPrep

public Token findPrep(Sentence sentence,
                      Token token)


Copyright © 2012-2013 CoGrOO. All Rights Reserved.