import sys sys.path.insert(0, '.') from anti_hallucination import strip_dates, extract_dates, clean_generated_content # Test 1: Basic date stripping test1 = "It was April 23, 2026, around 3:45 PM on a Tuesday afternoon." print("TEST 1: Basic date stripping") print(f" Input: {test1}") print(f" Output: {strip_dates(test1)}") print(f" Found: {extract_dates(test1)}") print() # Test 2: Multiple dates test2 = "Last Wednesday at 2:30 PM, I started. By Thursday morning 2026, it was fixed." print("TEST 2: Multiple dates") print(f" Input: {test2}") print(f" Output: {strip_dates(test2)}") print(f" Found: {extract_dates(test2)}") print() # Test 3: Real generated content (from pipeline output) test3 = """**April 23, 2026, around 01:55 UTC - The Night I Broke DNS** It was one of those late nights where the world seemed to slow down just enough for me to notice every little detail. Around 01:55 UTC, I found myself in my home office, staring at a screen that displayed nothing but an infuriating Cloudflare Error 1033 on notes.hoffdesk.com.""" print("TEST 3: Real generated content") print(f" Input: {test3[:80]}...") print(f" Output: {strip_dates(test3)[:80]}...") print(f" Found: {extract_dates(test3)}") print() # Test 4: Full cleanup print("TEST 4: Full cleanup") cleaned = clean_generated_content(test3) print(f" Clean: {cleaned[:100]}...") print(f" Dates remaining: {extract_dates(cleaned)}")