|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarytts.language.de.preprocess.ExpansionPattern
marytts.language.de.preprocess.NetEP
public class NetEP
An expansion pattern implementation for internet (URI or email) patterns.
| Field Summary | |
|---|---|
protected java.lang.String |
aText
|
protected java.lang.String |
domain
|
protected java.lang.String |
domainSuffix
|
protected java.lang.String |
dotAtomText
|
protected java.lang.String |
path
|
protected java.util.regex.Pattern |
reNetEmail
|
protected java.util.regex.Pattern |
reNetUri
|
protected java.lang.String |
sNetEmail
|
protected java.lang.String |
sNetUri
|
| Fields inherited from class marytts.language.de.preprocess.ExpansionPattern |
|---|
abbrev, composite, currency, date, duration, measure, multiword, net, number, specialChar, telephone, time |
| Constructor Summary | |
|---|---|
NetEP()
|
|
| Method Summary | |
|---|---|
protected int |
canDealWith(java.lang.String s,
int type)
Decide whether we can expand a string according to type typeCode. |
protected boolean |
doesFullExpansion()
Inform whether this module performs a full expansion of the input, or whether other patterns should be applied after this one. |
protected java.util.List |
expand(java.util.List tokens,
java.lang.String s,
int type)
Subclasses do their expansion in this class. |
protected java.util.List |
expandNetEmail(org.w3c.dom.Document doc,
java.lang.String s)
|
protected java.util.List |
expandNetUri(org.w3c.dom.Document doc,
java.lang.String s)
|
protected boolean |
isCandidate(org.w3c.dom.Element t)
|
java.util.List |
knownTypes()
Returns the types known by this ExpansionPattern. |
protected int |
match(java.lang.String s,
int type)
Subclasses do their matching in this class. |
java.util.regex.Pattern |
reMatchingChars()
Returns the regular expression object matching any of the chars occurring in the pattern. |
| Methods inherited from class marytts.language.de.preprocess.ExpansionPattern |
|---|
allowMultipleTokens, allPatterns, getPattern, getSplitAtChars, makeNewTokens, makeNewTokens, makeNewTokens, match, process, replaceTokens, reSplitAtChars, slowDown, slowDown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.lang.String aText
protected final java.lang.String dotAtomText
protected final java.lang.String sNetEmail
protected final java.lang.String domainSuffix
protected final java.lang.String domain
protected final java.lang.String path
protected final java.lang.String sNetUri
protected final java.util.regex.Pattern reNetEmail
protected final java.util.regex.Pattern reNetUri
| Constructor Detail |
|---|
public NetEP()
| Method Detail |
|---|
public java.util.List knownTypes()
ExpansionPatterntype attribute to the
say-as element, as defined in MaryXML.dtd.
Each subclass needs to override this to return something meaningful.
knownTypes in class ExpansionPatternpublic java.util.regex.Pattern reMatchingChars()
ExpansionPattern
reMatchingChars in class ExpansionPatternprotected boolean isCandidate(org.w3c.dom.Element t)
isCandidate in class ExpansionPatternprotected boolean doesFullExpansion()
doesFullExpansion in class ExpansionPattern
protected int canDealWith(java.lang.String s,
int type)
ExpansionPatterntypeCode. This is important in cases where a particular
expansion is requested via a say-as element.
As a default, reply that a string can be expanded if it would
be matched by the pattern recogniser. Subclasses may wish to
override this with less strict requirements.
Returns the type as which it can be expanded, or -1 if expansion is
not possible.
canDealWith in class ExpansionPattern
protected int match(java.lang.String s,
int type)
ExpansionPattern
match in class ExpansionPatterns - is the String to be matched,type - is the index in knownTypes to match with.
typeCode is a general type (typeCode == 0), it
may have matched with a more specific subtype). On failure,
-1 is returned.
protected java.util.List expand(java.util.List tokens,
java.lang.String s,
int type)
ExpansionPattern
expand in class ExpansionPatterntokens - is a list of token Elements to be replaced with their
expanded form. The expanded forms are inserted into the DOM tree at the
same positions as the tokens in List tokens. If there are
more new tokens than old tokens, the rest are inserted as siblings at
the position of the last old token.type - is the index in knownTypes this string has
matched with before.
protected java.util.List expandNetEmail(org.w3c.dom.Document doc,
java.lang.String s)
protected java.util.List expandNetUri(org.w3c.dom.Document doc,
java.lang.String s)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||