Overview

Classes

  • Horde_Date_Parser
  • Horde_Date_Parser_Handler
  • Horde_Date_Parser_Locale_Base
  • Horde_Date_Parser_Locale_Base_Grabber
  • Horde_Date_Parser_Locale_Base_Ordinal
  • Horde_Date_Parser_Locale_Base_Pointer
  • Horde_Date_Parser_Locale_Base_Repeater
  • Horde_Date_Parser_Locale_Base_Scalar
  • Horde_Date_Parser_Locale_Base_Separator
  • Horde_Date_Parser_Locale_Base_Timezone
  • Horde_Date_Parser_Locale_De
  • Horde_Date_Parser_Locale_De_Grabber
  • Horde_Date_Parser_Locale_De_Ordinal
  • Horde_Date_Parser_Locale_De_Pointer
  • Horde_Date_Parser_Locale_De_Repeater
  • Horde_Date_Parser_Locale_De_Scalar
  • Horde_Date_Parser_Locale_De_Separator
  • Horde_Date_Parser_Locale_De_Timezone
  • Horde_Date_Parser_Locale_Pt
  • Horde_Date_Parser_Locale_Pt_Grabber
  • Horde_Date_Parser_Locale_Pt_Ordinal
  • Horde_Date_Parser_Locale_Pt_Pointer
  • Horde_Date_Parser_Locale_Pt_Repeater
  • Horde_Date_Parser_Locale_Pt_Scalar
  • Horde_Date_Parser_Locale_Pt_Separator
  • Horde_Date_Parser_Locale_Pt_Timezone
  • Horde_Date_Parser_Result
  • Horde_Date_Parser_Token

Exceptions

  • Horde_Date_Parser_Exception
  • Overview
  • Class
  • Tree

Class Horde_Date_Parser_Locale_Pt

Horde_Date_Parser_Locale_Base
Extended by Horde_Date_Parser_Locale_Pt
Located at Horde/Date/Parser/Locale/Pt.php
Methods summary
public
# __construct( mixed $args )

Overrides

Horde_Date_Parser_Locale_Base::__construct()
public
# parse( mixed $text, mixed $specifiedOptions = array() )

Parses a string containing a natural language date or time. If the parser

can 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 :past

and if an ambiguous string is given, it will assume it is in the

past. 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 off

of 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 the

given 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 text

that 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 be

assumed to be within the range of that time in the AM to that time

in the PM. For example, if you set it to 7, then the parser will

look for the time between 7am and 7pm. In the case of 5:00, it would

assume that means 5:00pm. If :none is given, no assumption

will be made, and the first matching instance of that time will

be used.

Parses a string containing a natural language date or time. If the parser

can 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 :past

and if an ambiguous string is given, it will assume it is in the

past. 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 off

of 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 the

given 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 text

that 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 be

assumed to be within the range of that time in the AM to that time

in the PM. For example, if you set it to 7, then the parser will

look for the time between 7am and 7pm. In the case of 5:00, it would

assume that means 5:00pm. If :none is given, no assumption

will be made, and the first matching instance of that time will

be used.

Overrides

Horde_Date_Parser_Locale_Base::parse()
public
# normalize_special_characters( mixed $str )

Replaces special characters with non-special equivalents source: http://pt2.php.net/manual/en/function.chr.php#93291

Replaces special characters with non-special equivalents source: http://pt2.php.net/manual/en/function.chr.php#93291

public
# preNormalize( mixed $text )

Clean up the specified input text by stripping unwanted characters,

converting idioms to their canonical form, converting number words

to numbers (three => 3), and converting ordinal words to numeric

ordinals (third => 3rd)

Clean up the specified input text by stripping unwanted characters,

converting idioms to their canonical form, converting number words

to numbers (three => 3), and converting ordinal words to numeric

ordinals (third => 3rd)

Overrides

Horde_Date_Parser_Locale_Base::preNormalize()
public
# numericizeOrdinals( mixed $text )

Convert ordinal words to numeric ordinals (third => 3rd)

Convert ordinal words to numeric ordinals (third => 3rd)

Overrides

Horde_Date_Parser_Locale_Base::numericizeOrdinals()
public
# initDefinitions( )

Overrides

Horde_Date_Parser_Locale_Base::initDefinitions()
public
# handle_rdn( mixed $tokens, mixed $options )
public
# handle_sd_rmn( mixed $tokens, mixed $options )
public
# handle_od_rmn( mixed $tokens, mixed $options )
Methods inherited from Horde_Date_Parser_Locale_Base
componentFactory(), dayOrTime(), dealiasAndDisambiguateTimes(), debug(), findWithin(), getAnchor(), getRepeaters(), handle_m_d(), handle_o_r_g_r(), handle_o_r_s_r(), handle_orr(), handle_p_s_r(), handle_r(), handle_r_g_r(), handle_rdn_rmn_sd_t_tz_sy(), handle_rmn_od(), handle_rmn_sd(), handle_rmn_sd_sy(), handle_rmn_sy(), handle_s_r_p(), handle_s_r_p_a(), handle_sd_rmn_sy(), handle_sd_sm_sy(), handle_sm_sd_sy(), handle_sm_sy(), handle_srp(), handle_sy_sm_sd(), numericizeNumbers(), postTokenize(), preTokenize(), tokensToSpan()
Properties summary
public array $definitions
# array()
public array $args
# array()
public mixed $now
#
API documentation generated by ApiGen