有没有人遇到过用任何语言编写的脚本/cl 应用程序,可以很好地处理人类输入的日期解析?我希望能够解析,例如:
- “3 到 4 周”
- “2 - 3 天”
- “3 周到 2 个月”
最佳答案
Chronic gem for ruby 将允许您以自然形式表达日期。
支持表单的一些示例(来自文档)
thursday november summer friday 13:00 mon 2:35 4pm yesterday at 4:00 last friday at 20:00 last week tuesday tomorrow at 6:45pm afternoon yesterday thursday last week 3 years ago 5 months before now 7 hours ago 7 days from now 1 week hence in 3 hours 1 year ago tomorrow
我没有使用过它,所以不能评论它的性能。
关于php - 人工输入的智能日期范围解析?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3473830/