Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: if a comparable field is empty use 0 instead of -1 #104

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: if a comparable field is empty use 0 instead of -1
  • Loading branch information
gabynevada committed Feb 14, 2024
commit f94d131c7e4e70e6a944a27909bc48b99cbb8321
6 changes: 3 additions & 3 deletions src/Biomatch.Domain/Models/StringDistance.cs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ public static int GeneralDemographicFieldDistance(ReadOnlySpan<char> a, ReadOnly

if (a.IsEmpty || b.IsEmpty)
{
return -1;
return 0;
}

return Levenshtein.GetDistance(a, b);
@@ -28,7 +28,7 @@ public static int MiddleNameDemographicFieldDistance(ReadOnlySpan<char> a, ReadO

if (a.IsEmpty || b.IsEmpty)
{
return -1;
return 0;
}

if ((a.Length == 1 || b.Length == 1) && a[0] == b[0])
@@ -48,7 +48,7 @@ public static int DateDemographicFieldDistance(ReadOnlySpan<byte> date1, ReadOnl

if (date1.IsEmpty || date2.IsEmpty)
{
return -1;
return 0;
}

// Check for inverted day and month
Loading