Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #209 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 882 897 +15
=========================================
+ Hits 882 897 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@Sriram-PR Thanks, it would be better for the extraction. Could you remove |
It matched calendar widgets (2026年10月) and placeholders (2019年12月XX日), and their day-1 dates beat the real date on the page.
|
done, |
Fixes #208
2025年10月12日(Chinese/Japanese) and2025년 10월 12일(Korean) weren't matched by any pattern incustom_parse, sinceYMD_PATTERNandYM_PATTERNonly accept-,/and.between the parts. Fast mode returned nothing and extensive mode usually fell back to the year.This adds
CJK_YMD_PATTERNtoextractors.pyand tries it in_date_candidatesright after the Y-M-D patterns.examine_text()cuts trailing non-digits (NON_DIGITS_REGEX), so by the time element text like公開日: 2025年10月12日reachescustom_parsethe final日is gone. The day suffix is therefore optional when no further digit follows.Year-month alone (
2025年10月) is left out on purpose: it mostly shows up in calendar widgets and placeholders (2019年12月XX日), and the day-1 dates it gave beat the real date on the page.find_date()with<p class="date">...</p>, before and after:公開日: 2025年10月12日2025年1月5日发布时间:2025年10月12日發佈日期:2025年10月12日게시일: 2025년 10월 12일2025年10月12日 10:30Tests: new
test_cjk_datesintests/unit_tests.py(valid dates throughcustom_parse, invalid ones like month 13 and Feb 30, year-month only and placeholders giving no date,find_datein both modes with<p class="date">and<time>, and a placeholder or archive list next to the real date). It fails on master.pytest: 42 passedTZ=Europe/Berlin python eval_gate.py: extensive F1 0.9490, fast 0.9265, both at the floor, so no change on the benchmarkruff check .,ruff format --check htmldate testsandmypy -p htmldatewith the dev extras: clean