You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.**Add 2-letter English aliases to `weekdayVocab()`** — append `'mo', 'tu', 'we', 'th', 'fr'` after the 3-letter English block (`mon/tue/wed/thu/fri/sat/sun`). Longest-first ordering preserved (3-letter tried before 2-letter). `fr` already present in German section; adding it to English section makes intent explicit and matches first (same result from `getDayOfWeekForString`).
18
+
2.**Add 2-letter English aliases to `weekdayVocab()`** — append `'mo', 'tu', 'fr'` after the 3-letter English block (`mon/tue/wed/thu/fri/sat/sun`). `we` and `th` excluded: both are high-frequency English words that would destructively consume text. `fr` already present in German section; adding it to English section makes intent explicit (same result from `getDayOfWeekForString`). Longest-first ordering preserved.
19
19
20
20
3.**Invalidate pattern cache** — `_weekdayPatterns` is built lazily from `weekdayVocab()`. Adding entries to the array changes the return value; since the cache is built per `MatchInput` instance, no reset needed.
21
21
@@ -33,9 +33,8 @@ Both bugs are addressed in the #177 tokenizer branch. Bug 1 is already resolved
Copy file name to clipboardExpand all lines: docs/specs/2026-06-01-fix-230-smart-input-week-and-weekday-aliases.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Both defects break user-visible output in the current 1.1.0 milestone. The week
11
11
## In scope
12
12
13
13
- Fix `weekPattern` in `MatchInput.getExpression()` so it does not consume any character beyond the week token itself.
14
-
- Add `mo`, `tu`, `we`, `th`, `fr` to `getWeekdayPattern()` as recognized English aliases (longest-first ordering; after the 3-letter set).
14
+
- Add `mo`, `tu`, `fr` to `getWeekdayPattern()` as recognized English aliases (longest-first ordering; after the 3-letter set). `we` and `th` are excluded — both are high-frequency English words that would destructively consume text (e.g. `"task we need to buy milk"` → `we` parsed as Wednesday).
15
15
- Add regression tests in `src/test/suite/input.test.ts` and/or `week-input.test.ts` covering the exact inputs from the issue report.
16
16
17
17
## Out of scope
@@ -25,7 +25,7 @@ Both defects break user-visible output in the current 1.1.0 milestone. The week
`getDayOfWeekForString` (dates.ts:86-90) already maps `mo → 1`, `tu → 2`, `we → 3`, `th → 4`, `fr → 5`. `getWeekdayPattern()` only lists 3-letter English forms (`mon`, `tue`, `wed`, `thu`, `fri`), so the 2-letter variants never reach `resolveWeekday`.
52
52
53
-
Fix: append `'mo', 'tu', 'we', 'th', 'fr'` after the 3-letter English group in the `alternatives` array (longest-first ordering preserved).
53
+
Fix: append `'mo', 'tu', 'fr'` after the 3-letter English group in the `alternatives` array (longest-first ordering preserved). `we` and `th` are excluded — `we` is a common English pronoun and would destructively consume words like "we" in `"task we need to buy milk"`; `th` appears at the start of many English words.
0 commit comments