最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Natural Language Date Parser for JS that supports arbitrary text surrounding e.g. - "Follow up next week&a

programmeradmin2浏览0评论

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 pletely 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

  • Is there a natural language parser for date/times in javascript?
  • JAVA: / - based on description it'd probably work... text to date only english
  • JAVA: .shtml - Too plex, java based. (Date Extraction from Text) *

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 pletely 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

  • Is there a natural language parser for date/times in javascript?
  • JAVA: http://ocpsoft/prettytime/ - based on description it'd probably work... text to date only english
  • JAVA: http://nlp.stanford.edu/software/sutime.shtml - Too plex, java based. (Date Extraction from Text) *
Share Improve this question edited May 23, 2017 at 12:17 CommunityBot 11 silver badge asked Dec 28, 2013 at 20:52 blak3rblak3r 16.6k17 gold badges82 silver badges98 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

I know you asked this question a long time ago, but I was looking for the same thing and I finally found ChonoJS

It does exactly what you're looking for.

However it supports only 4 languages, but it seems relatively easy to add new ones.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论