Skip to content

fix(analysis): rank the date culture whose separator the values use, and flag disagreeing readings - #59

Merged
vaceslav merged 1 commit into
mainfrom
fix/ambiguous-dates
Sep 29, 2026
Merged

vaceslav merged 1 commit into
mainfrom
fix/ambiguous-dates

Conversation

@vaceslav

Copy link
Copy Markdown
Contributor

Closes #58.

Both proposals from the issue, a tie-break and an ambiguity flag:

  • Tie-break. Among date hypotheses of equal confidence, the culture whose date separator the values are actually written with ranks first. The count is the new CultureParseCounts.DatesWithOwnSeparator. So 11.01.2018 now goes to de-DE (11 January). 11/01/2018 keeps its previous order, because the invariant culture and en-US share the slash. ISO dates match no culture's separator and read the same under all of them, so their order is unchanged too.
  • Facts follow the winner. MinDate and MaxDate come from the culture chosen by the same rule: numbers first, then dates, then dates written with the culture's own separator.
  • Flag. New ColumnFacts.DateReadingsDisagree is true when the cultures that read the most values as dates read some row as different dates. It is measured, not inferred. Each culture keeps an order-free sum over the rows of a hash of (row, date), so one row read otherwise sets two cultures apart, including symmetric cases such as 01.02 and 02.01.

Performance: analysis timings on the corpus are within −1.7 % to +0.8 % of main (median of 3 alternating runs).

Tests: AmbiguousDateTests, eight cases.

…at culture first, and the facts say when date readings disagree
@vaceslav
vaceslav merged commit 1fa72b3 into main Sep 29, 2026
9 checks passed
@vaceslav
vaceslav deleted the fix/ambiguous-dates branch September 29, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ambiguous day/month dates rank the invariant culture first, reading 11.01.2018 as 1 November

1 participant