Enhance event occurrence parsing to skip unmatched high school section headers

This commit introduces a new property to track skipped high school section headers in the EventOccurrenceParseResult and EventOccurrenceParserResult classes. The EventOccurrenceParser has been updated to gracefully skip HS section headers that do not match any event definitions, improving the parsing logic. Additionally, the LocationParsingConfiguration has been removed from the EventOccurrenceParser, simplifying its constructor. Unit tests have been updated to reflect these changes and ensure correct behavior during parsing.
This commit is contained in:
2026-01-09 00:14:19 -05:00
parent f916cfad6b
commit 19e5ef0675
10 changed files with 279 additions and 372 deletions
@@ -51,42 +51,23 @@ public class LineClassifier_Tests
}
[Test]
public void IsContinuationLine_StartsWithLowercaseContinuationWord_ReturnsTrue()
public void IsContinuationLine_StartsWithAsterisk_ReturnsTrue()
{
// Act & Assert
Assert.That(LineClassifier.IsContinuationLine("the event will be held"), Is.True);
Assert.That(LineClassifier.IsContinuationLine("and participants should arrive"), Is.True);
Assert.That(LineClassifier.IsContinuationLine("be sure to register"), Is.True);
Assert.That(LineClassifier.IsContinuationLine("or contact the coordinator"), Is.True);
}
[Test]
public void IsContinuationLine_StartsWithLowercase_NonContinuationWord_ReturnsFalse()
{
// Act & Assert
Assert.That(LineClassifier.IsContinuationLine("important: bring materials"), Is.False);
}
[Test]
public void IsContinuationLine_StartsWithUppercase_ReturnsFalse()
{
// Act & Assert
Assert.That(LineClassifier.IsContinuationLine("Important Event March 15"), Is.False);
}
[Test]
public void IsContinuationLine_ContainsSchedulePosted_ReturnsTrue()
{
// Act & Assert
Assert.That(LineClassifier.IsContinuationLine("Schedule Posted on website"), Is.True);
}
[Test]
public void IsContinuationLine_ContainsNote_ReturnsTrue()
{
// Act & Assert
Assert.That(LineClassifier.IsContinuationLine("Note: Additional information"), Is.True);
Assert.That(LineClassifier.IsContinuationLine("*The books of semifinalist teams"), Is.True);
Assert.That(LineClassifier.IsContinuationLine("*Note: Important details"), Is.True);
Assert.That(LineClassifier.IsContinuationLine("*This is a continuation line"), Is.True);
Assert.That(LineClassifier.IsContinuationLine(" *Line with leading whitespace"), Is.True);
}
[Test]
public void IsContinuationLine_DoesNotStartWithAsterisk_ReturnsFalse()
{
// Act & Assert
Assert.That(LineClassifier.IsContinuationLine("The event will be held"), Is.False);
Assert.That(LineClassifier.IsContinuationLine("Note: Additional information"), Is.False);
Assert.That(LineClassifier.IsContinuationLine("Important Event March 15"), Is.False);
Assert.That(LineClassifier.IsContinuationLine("Schedule Posted on website"), Is.False);
}
[Test]