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<Object> 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(ArrayList<Object> ex) |
protected static String |
getInterletterValues(String pat) |
protected static String |
getPattern(String word) |
protected ArrayList<Object> |
normalizeException(ArrayList<Object> ex) |
void |
parse(InputStream stream, PatternConsumer consumer) |
void |
startDocument()
Called when the document starts to be parsed.
|
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 name
public void startDocument()
SimpleXMLDocHandler
startDocument
in interface SimpleXMLDocHandler
public void startElement(String tag, Map<String,String> h)
SimpleXMLDocHandler
startElement
in interface SimpleXMLDocHandler
tag
- the tag name
h
- the tag's attributes
public 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 group
public void addException(String w, ArrayList<Object> e)
PatternConsumer
Hyphen
instances
addException
in interface PatternConsumer
public void addPattern(String p, String v)
PatternConsumer
addPattern
in interface PatternConsumer
p
- the pattern
v
- interletter values expressed as a string of digit characters.
Copyright © 2016. All rights reserved.