|
22 | 22 | $hasTemporal = "( { temporal::EXISTS } & {{ temporal.value != NON_TEMPORAL }} & !{{ tags[\"TIMEZONE\"] }} )"
|
23 | 23 |
|
24 | 24 | # Decades
|
| 25 | + # We might want to add "teens" but would need to change grammar to insist on "the" before it, but even then maybe too ambiguous? |
| 26 | + # "teens": "1X", |
25 | 27 | DECADES_MAP = {
|
| 28 | + "oughts": "0X", |
| 29 | + "noughts": "0X", |
26 | 30 | "twenties": "2X",
|
27 | 31 | "thirties": "3X",
|
28 | 32 | "forties": "4X",
|
|
124 | 128 | }
|
125 | 129 | $BasicOrdTerm = CreateRegex(Keys(BASIC_ORDINAL_MAP))
|
126 | 130 |
|
127 |
| - # Finanical Quarters |
| 131 | + # Financial Quarters |
128 | 132 | FISCAL_YEAR_QUARTER_MAP = {
|
129 | 133 | "Q1": FYQ1,
|
130 | 134 | "Q2": FYQ2,
|
|
265 | 269 | { (/suppertimes?/) => SUPPERTIME }
|
266 | 270 | { (/daylights?|days?|daytimes?/) => DAYTIME }
|
267 | 271 | { (/nighttimes?|nights?|overnights?/) => NIGHT }
|
268 |
| - { (/workday|work day|business hours/) => WORKDAY } |
| 272 | + { (/workday|work(ing)? day|business hours/) => WORKDAY } |
269 | 273 |
|
270 | 274 | # Seasons
|
271 | 275 | { (/summers?/) => SUMMER }
|
|
296 | 300 | { (/suns?/) => SUNDAY }
|
297 | 301 |
|
298 | 302 | { (/weekends?/) => WEEKEND }
|
299 |
| - { (/weekdays?/) => WEEKDAY } |
| 303 | + { (/weekdays?|workweek/) => WEEKDAY } |
300 | 304 |
|
301 | 305 | # Month
|
302 | 306 | { (/januarys?/) => JANUARY }
|
|
402 | 406 | { ( [ { tag:NNP } ]+ [ { tag:POS } ] /birthday/ ) => SimpleTime($0) }
|
403 | 407 |
|
404 | 408 | # Generic decade
|
405 |
| - { ( /the/? ( /\w+teen/ /$Decades/ ) ) |
| 409 | + { ( /the/? ( /\w+teen|twenty/ /$Decades/ ) ) |
406 | 410 | => IsoDate( Concat( Format("%02d", $0[0].numcompvalue), DECADES_MAP[Lowercase($0[1].word)]), NIL, NIL)
|
407 | 411 | }
|
408 | 412 | { ( /the/? ( /$Decades/ ) )
|
|
481 | 485 | { text: /\b(\d{4})\s*(?:-)\s*(\d{4})\b/ =>
|
482 | 486 | TimeRange( IsoDate($1, NIL, NIL), IsoDate($2, NIL, NIL) ) }
|
483 | 487 | { ( /the/ /weekend/ ) => WEEKEND }
|
| 488 | + { ( /work(ing)?/ /day/ ) => WORKDAY } |
| 489 | + { ( /business/ /hours/ ) => WORKDAY } |
| 490 | + { ( /work(ing)?/ /week/ ) => WEEKDAY } |
| 491 | + { ( /week|business/ /days?/ ) => WEEKDAY } |
484 | 492 |
|
485 | 493 | # Now a few time expressions
|
486 | 494 | { ( (/\d\d\d\d/) /hours?/? (/universal|zulu/ | /[a-z]+/ /standard|daylight/) /time/ ) => IsoTime($1[0].word, NIL, NIL) }
|
|
0 commit comments