mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-11-02 13:12:50 +00:00
* fix(verify_pdf): --ascii-dates catches the 2016-17 form again The quantity rule from #533 treated "17" as a bare non-year number, so "MSc Physics, 2016-17", "Sep 2016-17" and "2019-20 season" passed /apply Step 5d although the guide says a year on either side of the dash is enough, and all three were caught before #533. A year followed by a two-digit year is now a date pair; "1500-2000" and "2000-5000" stay quantities, and "17-2016" (number first) is not a date anyone writes. Two new cases; the date-pair one fails on master. * changelog: place the #698 entry under [Unreleased] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
3 files changed
+32
-2
No files matched your search
@@ -134,6 +134,17 @@ class FindNonAsciiDateRangesTests(unittest.TestCase):
|
||||
with self.subTest(text=text):
|
||||
self.assertEqual(len(find_non_ascii_date_ranges(text)), 1)
|
||||
|
||||
def test_year_and_two_digit_year_is_a_date_range(self):
|
||||
# The academic-year and season form, caught before the quantity rule
|
||||
# (#533) and suppressed by it because `17` is a bare non-year number.
|
||||
for text in ("MSc Physics, 2016\u201317", "Sep 2016\u201317", "2019\u201320 season", "2016 \u2013 17"):
|
||||
with self.subTest(text=text):
|
||||
self.assertEqual(len(find_non_ascii_date_ranges(text)), 1)
|
||||
|
||||
def test_two_digit_number_before_a_year_is_still_a_quantity(self):
|
||||
# Only year-first is the date form; `17-2016` is not a date anyone writes.
|
||||
self.assertEqual(find_non_ascii_date_ranges("items 17\u20132016"), [])
|
||||
|
||||
def test_two_years_joined_by_a_dash_are_still_a_date_range(self):
|
||||
for text in ("2016\u20132024", "1990\u20132010 programme", "Roles 2000\u20132024"):
|
||||
with self.subTest(text=text):
|
||||
|
||||
Reference in new issue
Block a user