Parsing text into date-time values

This idea started simple, as they all seem to do – make the Time plugin for “Tellbot":http://tellbot.code-bear.com more flexible in the input it recognizes. Currently it really only allows you to request the current time in different timezones. Simple really. Then I heard about a feature request over in the Supybot project for a routine that would recognize “fuzzy” or “relative” time values (e.g. “next week”, “tomorrow” or “in 5 minutes") so I set out first to find some existing code. After some “Google":http://wwww.google.com searches I found the following: Python: “datetime":http://www.python.org/docs , “time":http://www.python.org/docs , “eGenix":http://www.lemburg.com/python/mxExtensions.html and “DateUtil":https://moin.conectiva.com.br/DateUtil Perl: “Date::Manip":http//www.cpan.org and I’m still looking :) Simple. Really. uhh, yea ;) So far only Date::Manip supports the freeform style of input - I will have to make sure to compare outputs and borrow any unit tests it uses :) What the above libraries do offer is some serious heavy-weight date/calendar manipulation code so once the text is parsed into a date, they will be more than capable for manipulating that date. Even the author of Date::Manip “menti ons":http://www.cise.ufl.edu/~sbeck/DateManip.html#shouldiuse_date::manip that many of the other libraries are leaner and faster for core date manipulation. Since the above list of libraries do date manipulation so well it would be folly for me to start re-inventing the wheel in that area and with the only other flexible parsing library being in Perl, I think I’ll focus on the flexible parsing area and make sure that any of the above Python libraries can be used on the back-end.


Mentions