public class Timex extends Object implements Serializable
Example text with TIMEX3 annotation:
In Washington <TIMEX3 tid="t1" TYPE="DATE" VAL="PRESENT_REF"
temporalFunction="true" valueFromFunction="tf1"
anchorTimeID="t0">today</TIMEX3>, the Federal Aviation Administration
released air traffic control tapes from the night the TWA Flight eight
hundred went down.
TIMEX3 specification:
attributes ::= tid type [functionInDocument] [beginPoint] [endPoint]
[quant] [freq] [temporalFunction] (value | valueFromFunction)
[mod] [anchorTimeID] [comment]
tid ::= ID
{tid ::= TimeID
TimeID ::= t}
type ::= 'DATE' | 'TIME' | 'DURATION' | 'SET'
beginPoint ::= IDREF
{beginPoint ::= TimeID}
endPoint ::= IDREF
{endPoint ::= TimeID}
quant ::= CDATA
freq ::= Duration
functionInDocument ::= 'CREATION_TIME' | 'EXPIRATION_TIME' | 'MODIFICATION_TIME' |
'PUBLICATION_TIME' | 'RELEASE_TIME'| 'RECEPTION_TIME' |
'NONE' {default, if absent, is 'NONE'}
temporalFunction ::= 'true' | 'false' {default, if absent, is 'false'}
{temporalFunction ::= boolean}
value ::= Duration | Date | Time | WeekDate | WeekTime | Season | PartOfYear | PaPrFu
valueFromFunction ::= IDREF
{valueFromFunction ::= TemporalFunctionID
TemporalFunctionID ::= tf}
mod ::= 'BEFORE' | 'AFTER' | 'ON_OR_BEFORE' | 'ON_OR_AFTER' |'LESS_THAN' | 'MORE_THAN' |
'EQUAL_OR_LESS' | 'EQUAL_OR_MORE' | 'START' | 'MID' | 'END' | 'APPROX'
anchorTimeID ::= IDREF
{anchorTimeID ::= TimeID}
comment ::= CDATA
References
Guidelines:
http://www.timeml.org/tempeval2/tempeval2-trial/guidelines/timex3guidelines-072009.pdf
Specifications:
http://www.timeml.org/site/publications/timeMLdocs/timeml_1.2.1.html#timex3
XSD: http://www.timeml.org/timeMLdocs/TimeML.xsd
Constructor and Description |
---|
Timex() |
Timex(Element element) |
Timex(String val) |
Timex(String type,
String val) |
Timex(String type,
String val,
String altVal,
String tid,
String text,
int beginPoint,
int endPoint) |
Modifier and Type | Method and Description |
---|---|
String |
altVal() |
int |
beginPoint() |
int |
endPoint() |
boolean |
equals(Object o) |
static Timex |
fromMap(String text,
Map<String,String> map) |
static Timex |
fromXml(String xml) |
Calendar |
getDate()
Gets the Calendar matching the year, month and day of this Timex.
|
Pair<Calendar,Calendar> |
getRange()
Gets two Calendars, marking the beginning and ending of this Timex's range.
|
Pair<Calendar,Calendar> |
getRange(Timex documentTime)
Gets two Calendars, marking the beginning and ending of this Timex's range.
|
int |
hashCode() |
String |
text() |
String |
tid() |
String |
timexType() |
String |
toString() |
Element |
toXmlElement() |
String |
value() |
public Timex()
public Timex(Element element)
public Timex(String val)
public String value()
public String altVal()
public String text()
public String timexType()
public String tid()
public int beginPoint()
public int endPoint()
public Element toXmlElement()
public Calendar getDate()
public Pair<Calendar,Calendar> getRange()
public Pair<Calendar,Calendar> getRange(Timex documentTime)
documentTime
- The time the document containing this Timex was written. (Not
necessary for resolving all Timex expressions. This may be
null
, but then relative time expressions cannot be
resolved.)