1: <?php
2: class Horde_Date_Parser_Locale_Pt_Pointer extends Horde_Date_Parser_Locale_Base_Pointer
3: {
4: public $scanner = array(
5: '/^antes$/' => 'past',
6: '/^(depois(\s+de)?|ap[oó]s|dentro\s+de|daqui\s+a)$/' => 'future',
7: '/\bpast\b/' => 'past',
8: '/\bfuture\b/' => 'future',
9: '/\bin\b/' => 'future',
10: );
11:
12: public function scan($tokens)
13: {
14: foreach ($tokens as &$token) {
15: if ($t = $this->scanForAll($token)) {
16: $token->tag('pointer', $t);
17: }
18: }
19: return $tokens;
20: }
21:
22: public function scanForAll($token)
23: {
24: foreach ($this->scanner as $scannerItem => $scannerTag) {
25: if (preg_match($scannerItem, $token->word)) {
26: return $scannerTag;
27: }
28: }
29: }
30:
31: }
32: