public class TimeEP extends ExpansionPattern
| Modifier and Type | Field and Description |
|---|---|
protected Pattern |
reHour |
protected Pattern |
reHourMinute |
protected Pattern |
reHourMinuteSecond |
protected String |
sFinal |
protected String |
sHour |
protected String |
sHour12 |
protected String |
sMatchingChars |
protected String |
sMinute |
protected String |
sSecond |
protected String |
sSep |
protected String |
timeOfDay |
| Constructor and Description |
|---|
TimeEP()
Every subclass has its own logger.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
canDealWith(String s,
int type)
Decide whether we can expand a string according to type
typeCode. |
protected boolean |
canDealWithTimeHMS12(String s) |
protected boolean |
canDealWithTimeHMS24(String s) |
protected List<Element> |
expand(List<Element> tokens,
String s,
int type)
Subclasses do their expansion in this class.
|
protected List<Element> |
expandTimeH(Document doc,
String s) |
protected List<Element> |
expandTimeHM(Document doc,
String s) |
protected List<Element> |
expandTimeHMS(Document doc,
String s) |
protected List<Element> |
expandTimeHMS12(Document doc,
String s) |
protected List<Element> |
expandTimeHMS24(Document doc,
String s) |
List<String> |
knownTypes()
Returns the types known by this ExpansionPattern.
|
protected int |
match(String s,
int type)
Subclasses do their matching in this class.
|
protected boolean |
matchTimeH(String s) |
protected boolean |
matchTimeHM(String s) |
protected boolean |
matchTimeHMS(String s) |
Pattern |
reMatchingChars()
Returns the regular expression object matching any of the chars occurring in the pattern.
|
allowMultipleTokens, allPatterns, doesFullExpansion, getPattern, getSplitAtChars, isCandidate, makeNewTokens, makeNewTokens, makeNewTokens, match, process, replaceTokens, reSplitAtChars, slowDown, slowDownprotected final String sHour
protected final String sHour12
protected final String sMinute
protected final String sSecond
protected final String sSep
protected final String sFinal
protected final String sMatchingChars
protected final String timeOfDay
protected final Pattern reHour
protected final Pattern reHourMinute
protected final Pattern reHourMinuteSecond
public TimeEP()
public List<String> 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 Pattern reMatchingChars()
ExpansionPatternreMatchingChars in class ExpansionPatternprotected int match(String s, int type)
ExpansionPatternmatch 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 int canDealWith(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 ExpansionPatterns - inputtype - typeCodeprotected List<Element> expand(List<Element> tokens, String s, int type)
ExpansionPatternexpand 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.s - is the String to be expanded,type - is the index in knownTypes this string has matched with before.protected boolean matchTimeHMS(String s)
protected boolean matchTimeHM(String s)
protected boolean matchTimeH(String s)
protected boolean canDealWithTimeHMS12(String s)
protected boolean canDealWithTimeHMS24(String s)
Copyright © 2000–2016 DFKI GmbH. All rights reserved.