7

PROBLEM

Libraries like sugar.js can convert natural language date strings such as:
"next week" but cannot handle strings such as: "Blah blah blah... Follow up next week"

In my application, I need to process a paragraph of notes and detect action items in it. Siri and Google Calendar are able to do this.

Potential Solution

Option 1: Maintain a list of "Action Verbs" for each language such as "Follow Up", "Call back", "Remind me" and then grab the natural language date portion after it and pipe it into Sugar.js to get a date back.

I'm not sure if every language will work in this way though... like in all languages will there be ? or in some languages is the sentence structure be completely different...

Option2: I might be able to get back various supported prefixes from sugar.js locale specific grammars and by semi brute force pass in strings until I find a valid date.

QUESTION

Is there a library i've over looked that

  1. Works in Javascript
  2. Supports multiple languages
  3. Can handle arbitrary text surrounding the date grammar.

Related Posts

4

1 回答 1

8

我知道你很久以前问过这个问题,但我一直在寻找同样的东西,我终于找到了 ChonoJS

它完全符合您的要求。

但是它只支持 4 种语言,但添加新语言似乎相对容易。

于 2014-07-23T06:57:50.467 回答