Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: add addressmatch extensions #1120

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions src/AddressRegistry.Api.Oslo/AddressMatch/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public static string ToggleAbbreviations(this string input)
if (input.Contains("o.l.v."))
return input.Replace("o.l.v.", "Onze Lieve Vrouw");

if (input.Contains("onze-lieve-"))
emalfroy marked this conversation as resolved.
Show resolved Hide resolved
return input.Replace("onze-lieve-", "O.L. ");

if (input.Contains("sint"))
return input.Replace("sint", "st.");

Expand Down Expand Up @@ -78,6 +81,15 @@ public static string ToggleAbbreviations(this string input)
if (input.EndsWith("str."))
return input.Replace("str.", "straat");

if (input.StartsWith("heilige"))
return input.Replace("heilige", "h");

if (input.StartsWith("heilig"))
return input.Replace("heilig", "h");

if (input.StartsWith("k."))
return input.Replace("k.", "koning");

return input;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ public async Task CanFindFusieGemeenteByNiscode()
[InlineData("evergreen terras", "Evergreen Terrace")] // case insensitive
[InlineData("St-Evergreen Terrace", "Sint-Evergreen Terrace")] // replace abreviations in input
[InlineData("Onze Lieve Vrouw-Evergreen Terrace", "O.l.v.-Evergreen Terrace")] // replace abreviations in existing straatnaam
[InlineData("onze-lieve-vrouwemarkt", "O.-L.-Vrouwemarkt")] // replace abreviations in existing straatnaam
[InlineData("onze-lieve-vrouwstraat", "O.-L.-Vrouwstraat")] // replace abreviations in existing straatnaam
[InlineData("Heilig Hartlaan", "H.-Hartlaan")] // replace abreviations in existing straatnaam
[InlineData("Heilige Hartlaan", "H.-Hartlaan")] // replace abreviations in existing straatnaam
[InlineData("k.elisabethlaan", "Koningin Elisabethlaan")] // replace abreviations in existing straatnaam
[InlineData("Clevergreen Terrace Avenue", "Evergreen")] // containment of existing straatnaam
[InlineData("Evergreen", "Clevergreen Terrace Avenue")] // containment of input
[InlineData("Trammesantlei", "Evergreen Terrace", false)] // no match
Expand Down