Dot notation — "12.2025" (4-digit year required; "1.26" is rejected)
Czech month names — range walk with Dec→Jan wrap-around year inference, then standalone pass with m≥10 → defaultYear-1 heuristic. Longest-match alternation (names sorted desc by length) ensures cervenec beats cerven.
35 table-driven tests. All expected outputs verified against the live Python implementation before locking the table (see plan at docs/plans/2026-05-05-2337-go-rewrite-m2-2-parse-month-references.md).
Addresses risk #4 from the parent plan (Czech month parser semantics).
Test plan
cd go && go build ./... — clean compile
cd go && go test ./internal/domain/czech/... — 35/35 green
cd go && go test -race ./... — race-clean
make go-lint — clean, gofumpt-formatted
All test inputs spot-checked against PYTHONPATH=scripts:. python -c 'from czech_utils import parse_month_references; ...'
## Summary
Ports `parse_month_references` from `scripts/czech_utils.py` to Go as `internal/domain/czech.ParseMonthReferences`.
Three-pass implementation mirroring the Python logic exactly:
- **Numeric slash** — `"11+12/2025"`, `"01/26"`, plus-split months, 2-digit year → +2000
- **Dot notation** — `"12.2025"` (4-digit year required; `"1.26"` is rejected)
- **Czech month names** — range walk with Dec→Jan wrap-around year inference, then standalone pass with `m≥10 → defaultYear-1` heuristic. Longest-match alternation (names sorted desc by length) ensures `cervenec` beats `cerven`.
35 table-driven tests. All expected outputs verified against the live Python implementation before locking the table (see plan at `docs/plans/2026-05-05-2337-go-rewrite-m2-2-parse-month-references.md`).
Addresses risk #4 from the parent plan (Czech month parser semantics).
## Test plan
- [x] `cd go && go build ./...` — clean compile
- [x] `cd go && go test ./internal/domain/czech/...` — 35/35 green
- [x] `cd go && go test -race ./...` — race-clean
- [x] `make go-lint` — clean, gofumpt-formatted
- [x] All test inputs spot-checked against `PYTHONPATH=scripts:. python -c 'from czech_utils import parse_month_references; ...'`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Three-pass regex parser matching python/czech_utils.py parse_month_references:
1. Numeric slash notation — "11+12/2025", "01/26"; 2-digit year → +2000
2. Dot notation — "12.2025" (4-digit year only)
3. Czech month names — range walk (listopad-leden wrap logic) then
standalone with m≥10 → defaultYear-1 heuristic; longest-match
alternation (sorted desc by name length) handles cervenec vs cerven
35 table-driven tests, all expected outputs verified against live Python
on 2026-05-05 before locking. Plan at
docs/plans/2026-05-05-2337-go-rewrite-m2-2-parse-month-references.md.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr
merged commit 0a8017fffa into main2026-05-06 00:07:15 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Ports
parse_month_referencesfromscripts/czech_utils.pyto Go asinternal/domain/czech.ParseMonthReferences.Three-pass implementation mirroring the Python logic exactly:
"11+12/2025","01/26", plus-split months, 2-digit year → +2000"12.2025"(4-digit year required;"1.26"is rejected)m≥10 → defaultYear-1heuristic. Longest-match alternation (names sorted desc by length) ensurescervenecbeatscerven.35 table-driven tests. All expected outputs verified against the live Python implementation before locking the table (see plan at
docs/plans/2026-05-05-2337-go-rewrite-m2-2-parse-month-references.md).Addresses risk #4 from the parent plan (Czech month parser semantics).
Test plan
cd go && go build ./...— clean compilecd go && go test ./internal/domain/czech/...— 35/35 greencd go && go test -race ./...— race-cleanmake go-lint— clean, gofumpt-formattedPYTHONPATH=scripts:. python -c 'from czech_utils import parse_month_references; ...'🤖 Generated with Claude Code