From 5fdd5fadba83eabed3ade0ff3c4b2944d2262441 Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Thu, 8 Jan 2026 08:08:36 -0500 Subject: [PATCH] Enhance event occurrence parsing with new location patterns and improved issue handling This commit updates the LocationParsingConfiguration to include additional location patterns such as "Exhibit Hall *", "Mtg. Room *", and "Online". The EventOccurrenceParser has been enhanced to better handle parsing issues, including skipping comment and continuation lines, and cleaning up location text. New methods for analyzing location parsing failures and categorizing issues have been added to improve reporting. Additionally, the UI has been updated to support larger input sizes for event occurrence text, ensuring a smoother user experience during data import. --- Core/Models/LocationParsingConfiguration.cs | 10 +- Core/Parsers/EventOccurrenceParser.cs | 186 ++++++-- Tests/Parsers/EventOccurrenceParser_Tests.cs | 410 ++++++++++++++++-- .../Components/Features/Calendar/Import.razor | 22 +- WebApp/Program.cs | 11 +- 5 files changed, 572 insertions(+), 67 deletions(-) diff --git a/Core/Models/LocationParsingConfiguration.cs b/Core/Models/LocationParsingConfiguration.cs index 7f7b20e..44e6bf1 100644 --- a/Core/Models/LocationParsingConfiguration.cs +++ b/Core/Models/LocationParsingConfiguration.cs @@ -21,9 +21,17 @@ public class LocationParsingConfiguration { "Room *", "Hall *", + "Exhibit Hall *", "Conference Room *", "Building *", - "Auditorium *" + "Auditorium *", + "Mtg. Room *", + "Meeting Room *", + "Banquet Room *", + "Banquet Hall *", + "Online", + "Virtual", + "TBD" } }; } diff --git a/Core/Parsers/EventOccurrenceParser.cs b/Core/Parsers/EventOccurrenceParser.cs index 9f9a2cc..f1b33c9 100644 --- a/Core/Parsers/EventOccurrenceParser.cs +++ b/Core/Parsers/EventOccurrenceParser.cs @@ -42,10 +42,10 @@ public class EventOccurrenceParser // Matches: time1 (optional dash time2/NOON), then location // The time group captures the full time range (including " - NOON" if present) // Pattern breakdown: - // - First time: (?:NOON|\d{1,2}:?\d{0,2}\s?(?:[AaPp]\.?[Mm]\.?)) - matches NOON or time with AM/PM - // - Optional range: (?:\s*[–-]\s*(?:NOON|\d{1,2}:?\d{0,2}\s?(?:[AaPp]\.?[Mm]\.?))) - matches dash followed by NOON or time - // - Location: \s+.+ - whitespace followed by rest of string - private readonly Regex _timeLocationRegex = new(@"(?