I am searching for a way to extract date information from a string. After reading another SO thread (Extracting date from a string in Python), it seems python-dateutil is an ideal solution. It has a fuzzy parsing method that is able to extract date info from any string:
Specifically, the method is
dateutil.parser.parse('your string here', fuzzy=True)
This works fine for many types of input strings containing a date, but I noticed that this method completely breaks when the input string contains the determiner 'a', as in sentences like
dateutil.parser.parse('a monkey on March 1, 2015', fuzzy=True)
dateutil.parser.parse("I ate a sandwich on March 1",fuzzy=True)
which all result in an error:
ValueError: Unknown string format
Does anyone know of a good workaround? Why does dateutil.parser break when the input contains the article "a"?