I'm building a system that needs to provide a commentary on things in natural English. One thing that is of use is to be able to express dates in a casual format. What I'm looking for is essentially the inverse of Chronic, Natty, or the task described in this question: Natural Language date and time parser for java.
Is this too out-there to have been done? Should I try and roll my own simple hardwired piece for the date ranges that make sense to me? Or is there some clever way to reverse existing parsers to spit out (even garbled) sentences describing dates?
EDIT - To clarify, although any kind of output is interesting and useful, I'm particularly interested in varied/creative output generation. i.e. "Next week", "seven days from now", "next Thursday" and "late next week" all for the same date.
There isn't much out there. Personally I'd love to see a variant of SimpleDateFormatter called RelativeDateFormatter that would let one create their own variations of relative date formats. Here is what I found:
Just an aside, I noticed this post about why relative date formats suck. Providing only relative dates can be a mistake: if the information is going to be saved at a later date, the relative date could be useless. In a website I made I provided a mouseover with the absolute date, and CSS rules to print the absolute date. I guess the thing to keep in mind: consider how/when the dates will be viewed. If they're anything other than "NOW" then you might want to consider including the absolute date as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With