Class Horde_Date_Parser_Locale_Base
Located at Horde/Date/Parser/Locale/Base.php
public
|
|
public
|
#
parse( mixed $text, mixed $specifiedOptions = array() )
Parses a string containing a natural language date or time. If the parsercan find a date or time, either a Horde_Date or Horde_Date_Span will be returned(depending on the value of :return). If no date or time can be found,+nil+ will be returned.# Options are:# [:context]:past or :future (defaults to :future)# If your string represents a birthday, you can set :context to :pastand if an ambiguous string is given, it will assume it is in thepast. Specify :future or omit to set a future context.# [:now]Time (defaults to time())# By setting :now to a Horde_Date, all computations will be based offof that time instead of time().# [:return]'result', 'span', or 'date' (defaults to 'date')# By default, the parser will guess a single point in time for thegiven date or time. If you'd rather have the entire time span returned,set :return to 'span' and a Horde_Date_Span will be returned.If you want the entire result, including tokens (for retrieving the textthat was or was not tagged, for example), set :return to 'result'and you will get a result object.# [:ambiguousTimeRange]Integer or :none (defaults to 6 (6am-6pm))# If an Integer is given, ambiguous times (like 5:00) will beassumed to be within the range of that time in the AM to that timein the PM. For example, if you set it to 7, then the parser willlook for the time between 7am and 7pm. In the case of 5:00, it wouldassume that means 5:00pm. If :none is given, no assumptionwill be made, and the first matching instance of that time willbe used. |
public
|
|
public
|
#
preNormalize( mixed $text )
Clean up the specified input text by stripping unwanted characters,converting idioms to their canonical form, converting number wordsto numbers (three => 3), and converting ordinal words to numericordinals (third => 3rd) |
public
|
|
public
|
|
public
array
|
|
public
array
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
findWithin( mixed $tags, mixed $span, mixed $pointer )
Recursively finds repeaters within other repeaters. Returns a Span representing the innermost time span or null if no repeater union could be found |
public
|
#
dealiasAndDisambiguateTimes( mixed $tokens, mixed $options )
handle aliases of am/pm 5:00 in the morning -> 5:00 am 7:00 in the evening -> 7:00 pm |
public
array
|
$definitions
|
#
array()
|
public
array
|
$args
|
#
array()
|
public
mixed
|
$now
|