neilgupta / Sherlock

Natural-language event parser for Javascript
https://sherlock.neil.gg
MIT License
532 stars 32 forks source link

End date not detected #10

Closed bendtherules closed 10 years ago

bendtherules commented 10 years ago
Event starts today ends within two days

parses to:

Title: event starts ends within two days
Starts: Sun Jun 01 2014 00:00:00 GMT+0530 (India Standard Time) 
Ends: null
All day: true
Validated: true

End date detection was poor across a lot of examples I tried. Here, also the title is misinterpreted.

neilgupta commented 10 years ago

Thanks for the bug report. It should be working now. Starts and ends are now valid range separators.

What other examples had poor date detection?

bendtherules commented 10 years ago

Not working: [End date]

Event starts today continues for 15 days
Event ends in 15 days, starts today
Event starts tomorrow, due in 5 month

[Title]

Sherlock dances on a donkey tomorrow :D
Let's have lunch on the 3rd at my place

I think you disabled catching phrases between on and some date to allow for dates like "on the 3rd", but this things might also occur.

[Oddball]

Event starts tomorrow, due in 5 month
Event starts tomorrow due in 5 month
Should i do it monday?
Should i do it on monday?

Difference of phrase is subtle, but title differs.

bendtherules commented 10 years ago

Suggestion: Have some sort of identifier to disable time detection for a part of the line. Ex: watch the "sun" shine tomorrow Although its use case is quite rare, I admit.