public class SimplePatternParser extends Object implements SimpleXMLDocHandler, PatternConsumer
Constructor and Description |
---|
SimplePatternParser()
Creates a new instance of PatternParser2
|
Modifier and Type | Method and Description |
---|---|
void |
addClass(String c)
Add a character class.
|
void |
addException(String w,
ArrayList e)
Add a hyphenation exception.
|
void |
addPattern(String p,
String v)
Add hyphenation patterns.
|
void |
endDocument()
Called after the document is parsed.
|
void |
endElement(String tag)
Called when an end tag is found.
|
protected String |
getExceptionWord(List<Object> ex) |
protected static String |
getInterletterValues(String pat) |
protected static String |
getPattern(String word) |
static void |
main(String[] args) |
protected List<Object> |
normalizeException(List<Object> ex) |
void |
parse(InputStream stream,
PatternConsumer consumer) |
void |
startDocument()
Called when the document starts to be parsed.
|
void |
startElement(String tag,
HashMap h)
Deprecated.
|
void |
startElement(String tag,
Map<String,String> h)
Called when a start tag is found.
|
void |
text(String str)
Called when a text element is found.
|
public SimplePatternParser()
public void parse(InputStream stream, PatternConsumer consumer)
public void endDocument()
SimpleXMLDocHandler
endDocument
in interface SimpleXMLDocHandler
public void endElement(String tag)
SimpleXMLDocHandler
endElement
in interface SimpleXMLDocHandler
tag
- the tag namepublic void startDocument()
SimpleXMLDocHandler
startDocument
in interface SimpleXMLDocHandler
@Deprecated public void startElement(String tag, HashMap h)
startElement(String, Map)
SimpleXMLDocHandler
startElement
in interface SimpleXMLDocHandler
tag
- the tag nameh
- the tag's attributespublic void startElement(String tag, Map<String,String> h)
SimpleXMLDocHandler
startElement
in interface SimpleXMLDocHandler
tag
- the tag nameh
- the tag's attributespublic void text(String str)
SimpleXMLDocHandler
text
in interface SimpleXMLDocHandler
str
- the text element, probably a fragment.public void addClass(String c)
PatternConsumer
addClass
in interface PatternConsumer
c
- character grouppublic void addException(String w, ArrayList e)
PatternConsumer
Hyphen
instancesaddException
in interface PatternConsumer
public void addPattern(String p, String v)
PatternConsumer
addPattern
in interface PatternConsumer
p
- the patternv
- interletter values expressed as a string of
digit characters.public static void main(String[] args)
Copyright © 2020. All rights reserved.