Skip to content

Commit

Permalink
add DATE token type, see issue #873
Browse files Browse the repository at this point in the history
  • Loading branch information
grandsbor committed Jul 8, 2020
1 parent 19a5ce0 commit f87b89e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/lib_annot.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ private function _from_token($token, $force_unknown, $force_include_init, $restr
$this->parses[] = new MorphParse($token, array(array('inner' => 'NUMB')));
} elseif (preg_match('/^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/u', $token)) {
$this->parses[] = new MorphParse($token, array(array('inner' => 'TIME')));
} elseif (preg_match('/^(0?[1-9]|[12][0-9]|3[01])[-.](0[1-9]|1[12])[-.]([12][0-9])?[0-9]{2}$/u', $token)) {
$this->parses[] = new MorphParse($token, array(array('inner' => 'DATE')));
} elseif (preg_match('/^[\p{Latin}\.-]+$/u', $token)) {
$this->parses[] = new MorphParse($token, array(array('inner' => 'LATN')));
} elseif (preg_match('/^\p{S}+$/u', $token)) {
Expand Down

0 comments on commit f87b89e

Please sign in to comment.