TimeContext Struct Reference

List of all members.

Public Member Functions

 TimeContext ()
 Constructor.
void BuildContextFromData (Data *p)
 Traverse semantic time data.
void Print ()
 Print value of TimeContext.
void SetTime (double &startTime, double &endTime)

Public Attributes

Id mMonth
 January-December.
int mMonthDay
 1-31
Id mWeekDay
 Sunday-Saturday.
Id mRelativeDay
 today, tomorrow, yesterday
Id mPartOfDay
 morning, tonight, evening, afternoon
Id mAmPm
 AM or PM.
double mHour
 Numerical hour.

Constructor & Destructor Documentation

TimeContext::TimeContext  ) 
 

Constructor.


Member Function Documentation

void TimeContext::BuildContextFromData Data p  ) 
 

Traverse semantic time data.

void TimeContext::Print  ) 
 

Print value of TimeContext.

void TimeContext::SetTime double &  startTime,
double &  endTime
 

Set startTime and endTime based on time semantic data.

  • If an hour is specified, the startTime will be that hour, end time will be 1.25 hours later.
  • Resolving the 8 am vs 8 pm ambiguity. If am/pm specified, then no ambiguity. If day is today (or not specified) and am time has passed, then no ambiguity. Only ambiguous 1-12 (i.e. 13 is in pm). Ambiguity can be resolved by morning, afternoon, evening. If ambiguity is not resolved, assume am. TODO: Improve the above comment and make sure it matches the code.
  • am: midnight - noon
  • pm: noon - midnight
  • night: 5pm - 1am
  • tonight: 5pm - 1am
  • morning: 5am - noon
  • day: 5am - 7pm
  • afternoon: noon - 6pm
  • evening: 3pm - 11pm


Member Data Documentation

Id TimeContext::mAmPm
 

AM or PM.

double TimeContext::mHour
 

Numerical hour.

Id TimeContext::mMonth
 

January-December.

int TimeContext::mMonthDay
 

1-31

Id TimeContext::mPartOfDay
 

morning, tonight, evening, afternoon

Id TimeContext::mRelativeDay
 

today, tomorrow, yesterday

Id TimeContext::mWeekDay
 

Sunday-Saturday.


The documentation for this struct was generated from the following file:
Generated on Sun Oct 8 09:32:10 2006 for gabbie by  doxygen 1.4.6