Class DisambiguationRuleHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.languagetool.rules.patterns.XMLRuleHandler
org.languagetool.tagging.disambiguation.rules.DisambiguationRuleHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate intprivate StringBuilderprivate List<DisambiguatedExample> private static final Stringprivate Stringprivate intprivate StringBuilderprotected Stringprotected Stringprivate booleanprivate booleanprivate booleanprivate Stringprivate booleanprivate booleanprivate Stringprivate List<AnalyzedToken> private Stringprivate Matchprivate List<DisambiguationPatternRule> private List<DisambiguationPatternRule> private Stringprivate Stringprivate final List<DisambiguationPatternRule> private intprivate intprivate intprivate intprivate booleanprivate StringBuilderprivate static final Stringprivate Stringprivate StringFields inherited from class org.languagetool.rules.patterns.XMLRuleHandler
AND, andGroupCounter, ANTIPATTERN, CASE_SENSITIVE, caseSensitive, chunkTag, CHUNKTAG, correctExample, correctExamples, DEFAULT, elements, endPositionCorrection, equivalenceFeatures, errorTriggerExample, errorTriggeringExamples, EXAMPLE, exampleCorrection, EXCEPTION, exceptionLevelCaseSensitive, exceptionLevelCaseSet, exceptionPosNegation, exceptionPosRegExp, exceptionPosToken, exceptions, exceptionSet, exceptionSpaceBefore, exceptionSpaceBeforeSet, exceptionStringInflected, exceptionStringNegation, exceptionStringRegExp, exceptionValidNext, exceptionValidPrev, FEATURE, id, ID, IGNORE, inAndGroup, incorrectExample, inCorrectExample, incorrectExamples, inErrorTriggerExample, inException, INFLECTED, inIncorrectExample, inMarker, inMatch, inMessage, inOrGroup, inPattern, inPhrases, inRegex, inRuleGroup, inShortMessage, inShortMessageForRuleGroup, inSuggestion, inToken, inUnification, inUnificationDef, inUnificationNeutral, inUrl, inUrlForRuleGroup, language, lastPhrase, MARK, MARKER, match, MATCH, MAX, maxOccurrence, message, MESSAGE, MIN, minOccurrence, NAME, NEGATE, NEGATE_POS, NO, OFF, ON, OR, orGroupCounter, PATTERN, patternToken, patternTokens, phraseId, phraseIdRef, phraseMap, phrasePatternTokens, PHRASES, pLocator, posNegation, posRegExp, POSTAG, POSTAG_REGEXP, posToken, regex, regexCaseSensitive, regexMode, REGEXP, regexpMark, regExpression, RULE, RULEGROUP, RULES, SCOPE, shortMessage, shortMessageForRuleGroup, SKIP, skipPos, SPACEBEFORE, startPositionCorrection, SUGGESTION, suggestionMatches, suggestionMatchesOutMsg, suggestionsOutMsg, TABNAME, TEMP_OFF, TOKEN, tokenCounter, tokenInflected, tokenLevelCaseSensitive, tokenLevelCaseSet, tokenNegated, tokenReference, tokenSpaceBefore, tokenSpaceBeforeSet, TYPE, uFeature, UNIFICATION, UNIFY, UNIFY_IGNORE, uniNegation, url, urlForRuleGroup, uType, uTypeList, YES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddNewWord(String word, String lemma, String pos) final voidcharacters(char[] buf, int offset, int len) voidendElement(String namespaceURI, String sName, String qName) (package private) List<DisambiguationPatternRule> private voidrefNumberSanityCheck(int refNumber) voidstartElement(String namespaceURI, String lName, String qName, Attributes attrs) Methods inherited from class org.languagetool.rules.patterns.XMLRuleHandler
addLegacyMatches, error, finalizeExceptions, finalizePhrase, finalizeTokens, getRules, preparePhrase, processElement, resetException, resetToken, setDocumentLocator, setExceptions, setMatchElement, setRuleFilter, setToken, startPattern, warningMethods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDeclMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
WD
- See Also:
-
ACTION
- See Also:
-
DISAMBIG
- See Also:
-
rules
-
inDisambiguation
private boolean inDisambiguation -
subId
private int subId -
name
-
ruleGroupId
-
ruleGroupName
-
filterClassName
-
filterArgs
-
disamb
-
wd
-
example
-
antiPatternCounter
private int antiPatternCounter -
inRule
private boolean inRule -
rulegroupAntiPatterns
-
ruleAntiPatterns
-
inAntiPattern
private boolean inAntiPattern -
inWord
private boolean inWord -
disambiguatedPOS
-
startPos
private int startPos -
endPos
private int endPos -
tokenCountForMarker
private int tokenCountForMarker -
posSelector
-
uniCounter
private int uniCounter -
newWdList
-
wdLemma
-
wdPos
-
inExample
private boolean inExample -
untouched
private boolean untouched -
untouchedExamples
-
disambExamples
-
input
-
output
-
disambigAction
-
-
Constructor Details
-
DisambiguationRuleHandler
DisambiguationRuleHandler()
-
-
Method Details
-
getDisambRules
List<DisambiguationPatternRule> getDisambRules() -
startElement
public void startElement(String namespaceURI, String lName, String qName, Attributes attrs) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
refNumberSanityCheck
- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
addNewWord
-
characters
public final void characters(char[] buf, int offset, int len) - Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler
-