是否有一个库(最好是 JavaScript,但不是必需的)接受一组日期时间对象并执行自然语言生成并生成人类可读的句子?
例如
["monday","tuesday","wednesday","thrusday","friday"] // "on weekdays"
[9,10,11,12,13,14] // "between 9am and 2pm"
它只需要用英语工作,但当然最好有额外的语言支持。
是否有一个库(最好是 JavaScript,但不是必需的)接受一组日期时间对象并执行自然语言生成并生成人类可读的句子?
例如
["monday","tuesday","wednesday","thrusday","friday"] // "on weekdays"
[9,10,11,12,13,14] // "between 9am and 2pm"
它只需要用英语工作,但当然最好有额外的语言支持。
找到了一个 C# 库,它采用 cron 表达式并生成自然语言输出:https ://github.com/bradyholt/cron-expression-descriptor