org.cogroo.checker
Class GrammarChecker

java.lang.Object
  extended by org.cogroo.checker.GrammarChecker
All Implemented Interfaces:
CheckAnalyzer

public class GrammarChecker
extends Object
implements CheckAnalyzer


Constructor Summary
GrammarChecker(Analyzer pipe)
          Creates an analyzer that will call the available checker.
GrammarChecker(Analyzer pipe, boolean allowOverlap, long[] activeXmlRules)
           
GrammarChecker(Analyzer pipe, String serializedRule)
           
 
Method Summary
 void analyze(CheckDocument document)
          Analyzes part of a text or a word.
 void analyze(CheckDocument document, boolean filterInvalidSuggestions)
           
 Set<RuleDefinition> getRuleDefinitions()
           
 void ignoreRule(String ruleIdentifier)
           
static void main(String[] args)
           
 void resetIgnoredRules()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrammarChecker

public GrammarChecker(Analyzer pipe)
               throws IllegalArgumentException,
                      IOException
Creates an analyzer that will call the available checker. Today it is hard coded, but it is in the TODO list that we should make it more flexible, specially because of other languages.

We have two different types of checkers: TypedCheckers are the one that uses the classes from XSD (package checker.rules.model), that should be deprecated in the future. They are:

Also we should have checker that deals with basic Document structure, but today we don't have any yet.

Throws:
IllegalArgumentException
IOException

GrammarChecker

public GrammarChecker(Analyzer pipe,
                      boolean allowOverlap,
                      long[] activeXmlRules)
               throws IllegalArgumentException,
                      IOException
Throws:
IllegalArgumentException
IOException

GrammarChecker

public GrammarChecker(Analyzer pipe,
                      String serializedRule)
               throws IllegalArgumentException,
                      IOException
Throws:
IllegalArgumentException
IOException
Method Detail

getRuleDefinitions

public Set<RuleDefinition> getRuleDefinitions()

analyze

public void analyze(CheckDocument document,
                    boolean filterInvalidSuggestions)

analyze

public void analyze(CheckDocument document)
Description copied from interface: CheckAnalyzer
Analyzes part of a text or a word.

For example, it can search all the sentences in the text or tag every word in a sentence.

Specified by:
analyze in interface CheckAnalyzer
Parameters:
document - contains the whole text given by the user. After an analysis it can store the text's sentences, words or its tags.

ignoreRule

public void ignoreRule(String ruleIdentifier)

resetIgnoredRules

public void resetIgnoredRules()

main

public static void main(String[] args)
                 throws IllegalArgumentException,
                        IOException
Parameters:
args - the language to be used, "pt_BR" by default
Throws:
IOException
IllegalArgumentException


Copyright © 2012-2013 CoGrOO. All Rights Reserved.