3 ms·
Nice, joestelmach! We're using JChronic (https://jchronic.dev.java.net/ https://jchronic.dev.java.net/) at DotSpots right now for this stuff internally. I'd lov
by mmastrac 16y ago
Nice, joestelmach! We're using JChronic (https://jchronic.dev.java.net/ https://jchronic.dev.java.net/) at DotSpots right now for this stuff internally. I'd love to switch to something better maintained.
FWIW, Ruby's chronic contains some date formats that this doesn't seem to support right now ('5 minutes ago'):
http://chronic.rubyforge.org/ http://chronic.rubyforge.org/
Aside: I'd really like to see a publicly-available set of natural language date test cases shared across these projects.
- joestelmach 16y agoThanks for the feedback. The chronic project was actually the original motivation behind natty. I think the chronic project is great, but I believe the grammar-based, AST approach is the way to go for long-term maintainability. Implementing relative times has been on my list of things to do (in addition to recurrence.) I created a feature request here: http://github.com/joestelmach/natty/issues#issue/4 http://github.com/joestelmach/natty/issues#issue/4, so feel free to list any time formats you'd like to see implemented. I agree that a generic list of test cases would be nice. Any thoughts on how such a list should be published?
- phaylon 16y agoA list that can be used for interoperability tests would be great, even across languages. For example, Perl has DateTime::Format::Natural that provides this functionality. There's a list of supported inputs at http://search.cpan.org/dist/DateTime-Format-Natural/lib/DateTime/Format/Natural/Lang/EN.pm http://search.cpan.org/dist/DateTime-Format-Natural/lib/Date... . I guess such a list of test-cases could simply be a JSON file containing the input strings plus an output specification. The options for output would only be explicit datetimes, datetimes relative to the now, or timespans.