|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.time.EnglishTimeExpressionPatterns
public class EnglishTimeExpressionPatterns
This class contains rules/patterns for transforming time related English expressions into temporal representations Many of the rules are based on expressions from GUTime (2.00)
| Nested Class Summary | |
|---|---|
protected static class |
EnglishTimeExpressionPatterns.PatternType
|
| Constructor Summary | |
|---|---|
EnglishTimeExpressionPatterns(Options options)
|
|
| Method Summary | |
|---|---|
protected static SUTime.Temporal |
addMod(java.lang.String expression,
SUTime.Temporal temporal)
|
protected SUTime.Temporal |
addSet(java.lang.String expression,
SUTime.Temporal temporal)
|
protected boolean |
checkTimeExpression(TimeExpression timeExpr)
Checks time expression against list of invalid time expressions |
CoreMapExpressionExtractor |
createExtractor()
Creates a CoreMapExpressionExtractor that knows how to extract time related expressions from text into CoreMaps |
static SUTime.IsoDate |
createIsoDate(java.lang.String year,
java.lang.String month,
java.lang.String day)
|
int |
determineRelFlags(CoreMap annotation,
TimeExpression te)
Determine how date/times should be resolved for the given temporal expression and its context |
protected SequenceMatchRules.ExtractRule<java.util.List<? extends CoreMap>,TimeExpression> |
getCompositeTimeExtractionRule()
|
SUTime.Duration |
getDuration(java.lang.String unit)
|
SUTime.Duration |
getDuration(java.lang.String val,
java.lang.String unit)
|
protected Filter<TimeExpression> |
getFilterRule()
|
java.util.regex.Pattern |
getPattern(java.lang.String regex)
|
protected SequenceMatchRules.ExtractRule<CoreMap,TimeExpression> |
getTimeExtractionRule()
|
SUTime.Temporal |
lookupTemporal(java.lang.String expr)
|
SUTime.TemporalOp |
lookupTemporalOp(java.lang.String expr)
|
SUTime.Time |
parseDateTime(java.lang.String dateStr)
Converts a string that represents some kind of date into ISO 8601 format and returns it as a SUTime.Time YYYYMMDDThhmmss |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EnglishTimeExpressionPatterns(Options options)
| Method Detail |
|---|
public CoreMapExpressionExtractor createExtractor()
TimeExpressionPatterns
createExtractor in interface TimeExpressionPatternsprotected boolean checkTimeExpression(TimeExpression timeExpr)
timeExpr - protected SequenceMatchRules.ExtractRule<CoreMap,TimeExpression> getTimeExtractionRule()
protected SequenceMatchRules.ExtractRule<java.util.List<? extends CoreMap>,TimeExpression> getCompositeTimeExtractionRule()
protected Filter<TimeExpression> getFilterRule()
public java.util.regex.Pattern getPattern(java.lang.String regex)
public SUTime.Duration getDuration(java.lang.String unit)
public SUTime.Duration getDuration(java.lang.String val,
java.lang.String unit)
public int determineRelFlags(CoreMap annotation,
TimeExpression te)
TimeExpressionPatterns
determineRelFlags in interface TimeExpressionPatternsannotation - Annotation from which the temporal express was extracted (context)te - Temporal expression
public SUTime.TemporalOp lookupTemporalOp(java.lang.String expr)
public SUTime.Temporal lookupTemporal(java.lang.String expr)
protected SUTime.Temporal addSet(java.lang.String expression,
SUTime.Temporal temporal)
protected static SUTime.Temporal addMod(java.lang.String expression,
SUTime.Temporal temporal)
public SUTime.Time parseDateTime(java.lang.String dateStr)
dateStr -
public static SUTime.IsoDate createIsoDate(java.lang.String year,
java.lang.String month,
java.lang.String day)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||