Documentation

De extends Base
in package

Tags
author

Chuck Hagenbuch chuck@horde.org

author

Jan Schneider jan@horde.org

license

http://www.horde.org/licenses/bsd BSD

category

Horde

Table of Contents

$BIG_PREFIXES  : mixed
$DIRECT_NUMS  : mixed
$TEN_PREFIXES  : mixed
$args  : mixed
Arguments from the constructor
__construct()  : mixed
Constructor
numerize()  : mixed
Rules:
_andition()  : mixed
_directReplacements()  : mixed
easy/direct replacements
_fractionalAddition()  : mixed
_hideAHalf()  : mixed
take the 'a' out so it doesn't turn into a 1, save the half for the end
_replaceBigPrefixes()  : mixed
hundreds, thousands, millions, etc.
_replaceTenPrefixes()  : mixed
ten, twenty, etc.
_splitHyphenatedWords()  : mixed
will mutilate hyphenated-words but shouldn't matter for date extraction

Properties

$BIG_PREFIXES

public mixed $BIG_PREFIXES = ['hundert' => 100, 'tausend' => 1000, 'million *' => 1000000, 'milliarde *' => 1000000000, 'billion *' => 1000000000000]

$DIRECT_NUMS

public mixed $DIRECT_NUMS = ['dreizehn' => 13, 'vierzehn' => 14, 'fünfzehn' => 15, 'sechzehn' => 16, 'siebzehn' => 17, 'achtzehn' => 18, 'neunzehn' => 19, 'ein[se]?' => 1, 'zwei' => 2, 'zwo' => 2, 'drei' => 3, 'vier' => 4, 'fünf' => 5, 'sechs' => 6, 'sieben' => 7, 'acht' => 8, 'neun' => 9, 'zehn' => 10, 'elf' => 11, 'zwölf' => 12]

$TEN_PREFIXES

public mixed $TEN_PREFIXES = ['zwanzig' => 20, 'dreißig' => 30, 'vierzig' => 40, 'fünfzig' => 50, 'sechzig' => 60, 'siebzig' => 70, 'achtzig' => 80, 'neunzig' => 90]

$args

Arguments from the constructor

protected mixed $args

Methods

__construct()

Constructor

public __construct(mixed $args) : mixed

These args are provided by existing code but went nowhere Assuming there was some intention, let's store the args

Parameters
$args : mixed
Return values
mixed

numerize()

Rules:

public numerize(mixed $string) : mixed
  • there are irregular word for 11 and 12 like in English
  • numbers below one million are written together (1 M = "eine Million", 100 = "einhundert")
  • "a" is declinable (see above, "one" = "eins", "a" = "ein/eine")
  • numbers below 100 are flipped compared to english, and have an "and = "und" (21 = "twenty-one" = "einundzwanzig")
Parameters
$string : mixed
Return values
mixed

_andition()

protected _andition(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

_directReplacements()

easy/direct replacements

protected _directReplacements(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

_fractionalAddition()

protected _fractionalAddition(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

_hideAHalf()

take the 'a' out so it doesn't turn into a 1, save the half for the end

protected _hideAHalf(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

_replaceBigPrefixes()

hundreds, thousands, millions, etc.

protected _replaceBigPrefixes(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

_replaceTenPrefixes()

ten, twenty, etc.

protected _replaceTenPrefixes(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

_splitHyphenatedWords()

will mutilate hyphenated-words but shouldn't matter for date extraction

protected _splitHyphenatedWords(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

Search results