org.cogroo.checker
Class GrammarChecker
java.lang.Object
org.cogroo.checker.GrammarChecker
- All Implemented Interfaces:
- CheckAnalyzer
public class GrammarChecker
- extends Object
- implements CheckAnalyzer
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: TypedChecker
s 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
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.