Skip to content

Commit 9cebf23

Browse files
authored
docs: drop the stale known issue on East Asian date formats and put HypothesisBuilder's doc comments on their methods (#192)
Two documentation fixes noticed while working on #184. - `docs/KNOWN-ISSUES.md` still listed "Number formats the reader does not know are dates", saying `IsBuiltInDateFormat` accepts only 14–22 and 45–47. It has accepted the East Asian date formats 27–36 and 50–58 as well for some time, so the entry described a problem that no longer exists. It is removed. - In `HypothesisBuilder`, the summary of `DeclaredByTheFile` sat above `OwnSeparatorDates`, which therefore carried two summaries, and a stray summary ("How much a reading claims") sat above `Favoured`, duplicating the one `Specificity` already has. The `DeclaredByTheFile` comment now sits on its method, and the stray one is gone. No code changes.
1 parent 26b0645 commit 9cebf23

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

‎docs/KNOWN-ISSUES.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ the delimiter test is off, and only the 100-line bound catches a stray quote.
2424
field boundary within one record. Neither the real-world nor the synthetic 5M-row fixture has such a
2525
case.
2626

27-
### Number formats the reader does not know are dates
28-
`IsBuiltInDateFormat` accepts 14–22 and 45–47. The specification also reserves 27–36 and 50–58 for
29-
dates in East Asian locales. A cell using one reads as a number.
30-
3127
### `applyNumberFormat="0"` is ignored
3228
The attribute says the format is not applied. Honouring it would change whether a styled cell is read
3329
as a date.

‎src/TriasDev.Tabular/Analysis/HypothesisBuilder.cs‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ public static IReadOnlyList<TypeHypothesis> Build(ColumnFacts facts, double mini
6565
.ThenBy(h => h.Culture, StringComparer.Ordinal)];
6666
}
6767

68-
/// <summary>
69-
/// Whether the file stated what every value is, which a workbook does and a csv file cannot.
70-
/// </summary>
71-
/// <remarks>
72-
/// Where it did, no culture is involved: the number was a number before anyone read it, and
73-
/// offering a choice of cultures would invent a question the file already answered.
74-
/// </remarks>
7568
/// <summary>
7669
/// For a date reading, how many of its dates are written with its culture's own separator: of two
7770
/// readings that fit every value, <c>11.01.2018</c> goes to the one that writes dates with dots (#58).
@@ -81,6 +74,13 @@ private static int OwnSeparatorDates(ColumnFacts facts, TypeHypothesis hypothesi
8174
? facts.ParseCounts.FirstOrDefault(c => c.Culture == hypothesis.Culture)?.DatesWithOwnSeparator ?? 0
8275
: 0;
8376

77+
/// <summary>
78+
/// Whether the file stated what every value is, which a workbook does and a csv file cannot.
79+
/// </summary>
80+
/// <remarks>
81+
/// Where it did, no culture is involved: the number was a number before anyone read it, and
82+
/// offering a choice of cultures would invent a question the file already answered.
83+
/// </remarks>
8484
private static bool DeclaredByTheFile(ColumnFacts facts)
8585
{
8686
int declared = Native(facts, RawCellKind.Number)
@@ -161,9 +161,6 @@ private static void Add(
161161
});
162162
}
163163

164-
/// <summary>
165-
/// How much a reading claims. Used only to order equally confident ones, narrowest first.
166-
/// </summary>
167164
/// <summary>
168165
/// Where numeric readings disagree, whether this one reads numbers with the separator the evidence
169166
/// favours (#61). Where they agree it decides nothing, and the order stays what it was.

0 commit comments

Comments
 (0)