LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
HistoricalMappingAuditResult.cs
Go to the documentation of this file.
2
3public sealed class HistoricalMappingAuditResult
4{
7 IEnumerable<string> declaredTokens,
8 IEnumerable<string> detectedTokens)
9 {
10 Family = family;
11 DeclaredTokens = Normalize(declaredTokens);
12 DetectedTokens = Normalize(detectedTokens);
13
15 .Except(DetectedTokens, StringComparer.Ordinal)
16 .OrderBy(value => value, StringComparer.Ordinal)
17 .ToArray();
18
20 .Except(DeclaredTokens, StringComparer.Ordinal)
21 .OrderBy(value => value, StringComparer.Ordinal)
22 .ToArray();
23 }
24
26 public IReadOnlyList<string> DeclaredTokens { get; }
27 public IReadOnlyList<string> DetectedTokens { get; }
28 public IReadOnlyList<string> DeclaredButNotDetected { get; }
29 public IReadOnlyList<string> DetectedButNotDeclared { get; }
30
31 public bool IsExactMatch =>
32 DeclaredButNotDetected.Count == 0 &&
33 DetectedButNotDeclared.Count == 0;
34
35 private static string[] Normalize(IEnumerable<string> values)
36 {
37 ArgumentNullException.ThrowIfNull(values);
38
39 return values
41 .Where(value => value.Length > 0)
42 .Distinct(StringComparer.Ordinal)
43 .OrderBy(value => value, StringComparer.Ordinal)
44 .ToArray();
45 }
46}
HistoricalMappingAuditResult(HistoricalClassificationFamily family, IEnumerable< string > declaredTokens, IEnumerable< string > detectedTokens)