Class BitextPatternRuleHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.languagetool.rules.patterns.XMLRuleHandler
-
- org.languagetool.rules.patterns.PatternRuleHandler
-
- org.languagetool.rules.patterns.bitext.BitextPatternRuleHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
class BitextPatternRuleHandler extends PatternRuleHandler
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<StringPair>
correctExamples
private java.util.List<IncorrectBitextExample>
incorrectExamples
private java.util.List<BitextPatternRule>
rules
private static java.lang.String
SOURCE
private static java.lang.String
SRC_EXAMPLE
private IncorrectExample
srcExample
private Language
srcLang
private PatternRule
srcRule
private static java.lang.String
TARGET
private static java.lang.String
TRG_EXAMPLE
private IncorrectExample
trgExample
private PatternRule
trgRule
-
Fields inherited from class org.languagetool.rules.patterns.PatternRuleHandler
category, categoryIssueType, filterArgs, filterClassName, name, ruleGroupIssueType, ruleIssueType, sourceFile, TYPE
-
Fields inherited from class org.languagetool.rules.patterns.XMLRuleHandler
AND, andGroupCounter, ANTIPATTERN, CASE_SENSITIVE, caseSensitive, chunkTag, CHUNKTAG, correctExample, 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, 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, ruleGroupId, RULES, SCOPE, shortMessage, shortMessageForRuleGroup, SKIP, skipPos, SPACEBEFORE, startPositionCorrection, SUGGESTION, suggestionMatches, suggestionMatchesOutMsg, suggestionsOutMsg, TABNAME, TEMP_OFF, TOKEN, tokenCounter, tokenInflected, tokenLevelCaseSensitive, tokenLevelCaseSet, tokenNegated, tokenReference, tokenSpaceBefore, tokenSpaceBeforeSet, uFeature, UNIFICATION, UNIFY, UNIFY_IGNORE, uniNegation, url, urlForRuleGroup, uType, uTypeList, YES
-
-
Constructor Summary
Constructors Constructor Description BitextPatternRuleHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName)
private PatternRule
finalizeRule()
(package private) java.util.List<BitextPatternRule>
getBitextRules()
private IncorrectExample
setExample()
void
startElement(java.lang.String namespaceURI, java.lang.String lName, java.lang.String qName, org.xml.sax.Attributes attrs)
-
Methods inherited from class org.languagetool.rules.patterns.PatternRuleHandler
characters, prepareRule
-
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, warning
-
-
-
-
Field Detail
-
SOURCE
private static final java.lang.String SOURCE
- See Also:
- Constant Field Values
-
TARGET
private static final java.lang.String TARGET
- See Also:
- Constant Field Values
-
SRC_EXAMPLE
private static final java.lang.String SRC_EXAMPLE
- See Also:
- Constant Field Values
-
TRG_EXAMPLE
private static final java.lang.String TRG_EXAMPLE
- See Also:
- Constant Field Values
-
rules
private final java.util.List<BitextPatternRule> rules
-
srcRule
private PatternRule srcRule
-
trgRule
private PatternRule trgRule
-
trgExample
private IncorrectExample trgExample
-
srcExample
private IncorrectExample srcExample
-
srcLang
private Language srcLang
-
correctExamples
private java.util.List<StringPair> correctExamples
-
incorrectExamples
private java.util.List<IncorrectBitextExample> incorrectExamples
-
-
Method Detail
-
getBitextRules
java.util.List<BitextPatternRule> getBitextRules()
-
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String lName, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classPatternRuleHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classPatternRuleHandler
- Throws:
org.xml.sax.SAXException
-
setExample
private IncorrectExample setExample()
-
finalizeRule
private PatternRule finalizeRule()
-
-