public class GrammarChecker extends Object implements CheckAnalyzer
| Constructor and Description |
|---|
GrammarChecker(Analyzer pipe)
Creates an analyzer that will call the available checker.
|
GrammarChecker(Analyzer pipe,
boolean allowOverlap,
long[] activeXmlRules) |
GrammarChecker(Analyzer pipe,
String serializedRule) |
| Modifier and Type | Method and Description |
|---|---|
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() |
public GrammarChecker(Analyzer pipe) throws IllegalArgumentException, IOException
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:
RulesApplier (rules from XML file)PunctuationCheckerRepetitionCheckerSpaceCheckerGovernmentChecker (beta)IllegalArgumentExceptionIOExceptionpublic GrammarChecker(Analyzer pipe, boolean allowOverlap, long[] activeXmlRules) throws IllegalArgumentException, IOException
IllegalArgumentExceptionIOExceptionpublic GrammarChecker(Analyzer pipe, String serializedRule) throws IllegalArgumentException, IOException
IllegalArgumentExceptionIOExceptionpublic Set<RuleDefinition> getRuleDefinitions()
public void analyze(CheckDocument document, boolean filterInvalidSuggestions)
public void analyze(CheckDocument document)
CheckAnalyzerFor example, it can search all the sentences in the text or tag every word in a sentence.
analyze in interface CheckAnalyzerdocument - contains the whole text given by the user. After an analysis it
can store the text's sentences, words or its tags.public void ignoreRule(String ruleIdentifier)
public void resetIgnoredRules()
public static void main(String[] args) throws IllegalArgumentException, IOException
args - the language to be used, "pt_BR" by defaultIOExceptionIllegalArgumentExceptionCopyright © 2012–2017 CoGrOO. All rights reserved.