acute 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +17 -0
  3. data/data/assumptions.yml +124 -0
  4. data/data/words.yml +699 -0
  5. data/exe/acute +4 -0
  6. data/lib/acute/assumption.rb +13 -0
  7. data/lib/acute/calendar.rb +91 -0
  8. data/lib/acute/chronic.rb +176 -0
  9. data/lib/acute/chronic_duration.rb +321 -0
  10. data/lib/acute/cli.rb +168 -0
  11. data/lib/acute/context.rb +205 -0
  12. data/lib/acute/describe.rb +316 -0
  13. data/lib/acute/duration.rb +120 -0
  14. data/lib/acute/errors.rb +47 -0
  15. data/lib/acute/explain.rb +165 -0
  16. data/lib/acute/extract.rb +493 -0
  17. data/lib/acute/grammar/clock_words.rb +109 -0
  18. data/lib/acute/grammar/compact.rb +222 -0
  19. data/lib/acute/grammar/duration.rb +93 -0
  20. data/lib/acute/grammar/nesting.rb +104 -0
  21. data/lib/acute/grammar/numbers.rb +378 -0
  22. data/lib/acute/grammar/ordinals.rb +101 -0
  23. data/lib/acute/grammar/ranges.rb +112 -0
  24. data/lib/acute/grammar/rule.rb +277 -0
  25. data/lib/acute/grammar/shifts.rb +226 -0
  26. data/lib/acute/grammar/words.rb +307 -0
  27. data/lib/acute/grammar.rb +378 -0
  28. data/lib/acute/holidays.rb +97 -0
  29. data/lib/acute/lexer.rb +487 -0
  30. data/lib/acute/locale.rb +53 -0
  31. data/lib/acute/mcp.rb +224 -0
  32. data/lib/acute/parser.rb +66 -0
  33. data/lib/acute/read.rb +21 -0
  34. data/lib/acute/resolve/clock.rb +75 -0
  35. data/lib/acute/resolve/dates.rb +75 -0
  36. data/lib/acute/resolve/day.rb +24 -0
  37. data/lib/acute/resolve/fuzzy.rb +91 -0
  38. data/lib/acute/resolve/named.rb +116 -0
  39. data/lib/acute/resolve/nth.rb +47 -0
  40. data/lib/acute/resolve/period.rb +160 -0
  41. data/lib/acute/resolve/periodic.rb +274 -0
  42. data/lib/acute/resolve/ranges.rb +165 -0
  43. data/lib/acute/resolve/recur.rb +187 -0
  44. data/lib/acute/resolve/rel.rb +146 -0
  45. data/lib/acute/resolve/shift.rb +81 -0
  46. data/lib/acute/resolve.rb +245 -0
  47. data/lib/acute/result.rb +128 -0
  48. data/lib/acute/rule/cron.rb +222 -0
  49. data/lib/acute/rule/expand.rb +401 -0
  50. data/lib/acute/rule.rb +232 -0
  51. data/lib/acute/tables/assumptions.rb +39 -0
  52. data/lib/acute/tables/words.rb +656 -0
  53. data/lib/acute/tables/zones.rb +930 -0
  54. data/lib/acute/tool/compact.rb +82 -0
  55. data/lib/acute/tool/ruby_llm.rb +29 -0
  56. data/lib/acute/tool.rb +192 -0
  57. data/lib/acute/verify.rb +216 -0
  58. data/lib/acute/version.rb +3 -0
  59. data/lib/acute/zone.rb +252 -0
  60. data/lib/acute.rb +160 -0
  61. data/schema/description.json +12 -0
  62. data/schema/duration.json +26 -0
  63. data/schema/extraction.json +30 -0
  64. data/schema/failure.json +29 -0
  65. data/schema/now.json +17 -0
  66. data/schema/result.json +45 -0
  67. data/schema/rule.json +19 -0
  68. data/schema/tools/describe.json +13 -0
  69. data/schema/tools/duration.json +12 -0
  70. data/schema/tools/extract.json +13 -0
  71. data/schema/tools/now.json +9 -0
  72. data/schema/tools/parse.json +13 -0
  73. data/schema/tools/recurrence.json +12 -0
  74. data/schema/tools/verify.json +14 -0
  75. data/schema/verdict.json +25 -0
  76. metadata +117 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6db307d10cb36e05af59196730d200f9bb4680343f8f01768a852a5bd5aba5de
4
+ data.tar.gz: 2b757ac98e117777b6637d42b6f0e4611b8503b8c6b12a8180fab70ff2425e4b
5
+ SHA512:
6
+ metadata.gz: e9b66b6696ab31eace0667d150e9762c30accc9e15846f8843553b547abfd729fa43ed3abf95c90a80a8ac6a9fe2faa5bf29f0962268852265c6749deb754311
7
+ data.tar.gz: 642748802a82a076608387006200c10ea324e146eb55607d650af08c5f8589a960eb7ad08713eb33605aad2730b113ac8ef1441706237d72bace4105effbe4f2
data/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2026 Alan Skorkin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation
7
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
8
+ to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of
11
+ the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
14
+ THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
16
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17
+ IN THE SOFTWARE.
@@ -0,0 +1,124 @@
1
+ # Every assumption a result can carry. bin/generate turns this into lib/acute/tables/assumptions.rb.
2
+ # The code is a stable public identifier; the rule is a section of docs/rules.md. short is what the tools give the model
3
+ # instead of message: its gist in about 45 chars, in acute's own words, never the input's.
4
+
5
+ bare_hour_window:
6
+ rule: D4
7
+ message: "no am/pm given: 6-11 read as am, 12 and 1-5 as pm; the other half of the day is an alternative"
8
+ short: "no am/pm: 6-11 am, 12-5 pm; the other is an alternative"
9
+ next_occurrence:
10
+ rule: D23
11
+ message: "that time has passed today, so it means the next one"
12
+ short: "that time has passed today, so the next one"
13
+ previous_occurrence:
14
+ rule: D23
15
+ message: "that time is still to come today, so in past context it means the previous one"
16
+ short: "still to come today, so looking back, the previous one"
17
+ equal_to_now:
18
+ rule: D36
19
+ message: "that time is now"
20
+ short: "that is now"
21
+ twelve_oclock:
22
+ rule: D30
23
+ message: "a time in the 12 o'clock hour without am/pm is read as pm"
24
+ short: "the 12 o'clock hour without am/pm is pm"
25
+ midnight_end_of_day:
26
+ rule: D6
27
+ message: "midnight with a day means the end of that day; its start is an alternative"
28
+ short: "midnight is the day's end; its start is an alternative"
29
+ machine_time:
30
+ rule: D29
31
+ message: "seconds were given, so the time is read as 24-hour"
32
+ short: "seconds given, so read as 24-hour"
33
+ tomorrow_after_midnight:
34
+ rule: D35
35
+ message: "\"tomorrow\" said before 04:00 means the coming day first; the calendar tomorrow is an alternative"
36
+ short: "\"tomorrow\" before 4am: today; next day is an alternative"
37
+ dst_repeated_time:
38
+ rule: D23
39
+ message: "that wall time happens twice as clocks go back; the earlier one is used"
40
+ short: "occurs twice as clocks go back; the earlier is used"
41
+ dst_skipped_time:
42
+ rule: D23
43
+ message: "that wall time doesn't exist as clocks go forward; it is moved forward by the gap"
44
+ short: "skipped as clocks go forward; moved on by the gap"
45
+ approximate:
46
+ rule: D14
47
+ message: "the time was given as approximate; the exact time is returned"
48
+ short: "approximate time; the exact time is given"
49
+ fixed_offset:
50
+ rule: D18
51
+ message: "the text names a zone or offset, which wins over the zone given"
52
+ short: "the text's zone wins over the zone given"
53
+ ambiguous_zone:
54
+ rule: D38
55
+ message: "the zone abbreviation names more than one zone; each one's offset is a reading, in order"
56
+ short: "ambiguous zone abbreviation; each zone is a reading"
57
+ numeric_date_order:
58
+ rule: D10
59
+ message: "a numeric date is read in the locale's order; the other order is an alternative"
60
+ short: "numeric date in locale order; the other is an alternative"
61
+ part_of_day_point:
62
+ rule: D1
63
+ message: "a part of the day is a range; its time is a representative point"
64
+ short: "a part of the day is a range; time is a point in it"
65
+ weekend_friday_evening:
66
+ rule: D8
67
+ message: "the weekend is Saturday 00:00 to Monday 00:00; from Friday 18:00 is an alternative"
68
+ short: "weekend is Sat-Sun; from Friday 6pm is an alternative"
69
+ meteorological_season:
70
+ rule: D3
71
+ message: "seasons are meteorological (three whole months) for the locale's hemisphere"
72
+ short: "seasons are whole months, for the locale's hemisphere"
73
+ century_from_00:
74
+ rule: D12
75
+ message: "a century runs from its 00 year, as most people count it; the 01-to-00 reading is an alternative"
76
+ short: "a century starts at year 00; from 01 is an alternative"
77
+ decade_or_century:
78
+ rule: D12
79
+ message: "a decade at a century's start (\"the 2000s\") is the decade; the whole century is an alternative"
80
+ short: "the decade is used; the whole century is an alternative"
81
+ season_year:
82
+ rule: D3
83
+ message: "a season that runs over New Year belongs to the year it starts in; the one ending in that year is an alternative"
84
+ short: "season by its start year; the end year is an alternative"
85
+ range_under_way:
86
+ rule: D11
87
+ message: "the range is under way, so it means the current one; the coming one is an alternative"
88
+ short: "under way, so the current one; the next is an alternative"
89
+ same_day_or_next:
90
+ rule: D11
91
+ message: "that day is today, so it means today; the next one is an alternative"
92
+ short: "that day is today; the next one is an alternative"
93
+ same_day_passed:
94
+ rule: D11
95
+ message: "that day is today but today's has passed (or, said looking back, has not come yet), so the other one comes first; today's is an alternative"
96
+ short: "the next (or previous) one first; today's is an alternative"
97
+ next_two_readings:
98
+ rule: D20
99
+ message: "\"next\" can mean the coming one or the one after; both are given, the coming one first"
100
+ short: "\"next\": the coming one; the one after is an alternative"
101
+ this_passed:
102
+ rule: D21
103
+ message: "that one has passed in the current period, so the next one comes first; the passed one is an alternative"
104
+ short: "passed, so the next one; the passed one is an alternative"
105
+ rolling_window:
106
+ rule: D31
107
+ message: "a span counted from now; whole calendar units are alternatives"
108
+ short: "counted from now; calendar units are alternatives"
109
+ zone_inferred:
110
+ rule:
111
+ message: "no zone was given; the zone comes from now, Time.zone or the system"
112
+ short: "no zone given, so a default zone is used"
113
+ weekday_mismatch:
114
+ rule: D37
115
+ message: "the weekday given doesn't fall on that date, so the date is used"
116
+ short: "the weekday doesn't match the date; the date is used"
117
+ also_duration:
118
+ rule: D45
119
+ message: "the text also reads as a length of time, which Acute.duration gives; read takes the time"
120
+ short: "also reads as a length of time; this is the time"
121
+ unknown_words_skipped:
122
+ rule: D22
123
+ message: "strict: false skipped words acute doesn't know; this is the first time in the rest of the text"
124
+ short: "skipped unknown words; first time in the rest"