iainbeeston / nickel

Nickel extracts date, time, and message information from naturally worded text.
MIT License
113 stars 17 forks source link

Having a dash "-" in the input with no date returns a daily occurrence beginning w/ the current day #26

Open chelsea opened 10 years ago

chelsea commented 10 years ago

This carries on from lzell/nickel#7

Messages with no time information which contain a dash return a time instance when they should not.

Nickel.parse("Hey guys - let's do the thing")
=> message: "Hey guys lets do the thing", occurrences: [#<Occurrence type: daily, start_date: 20140828, interval: 1>]

Would expect that no time information would be parsed in the above message.

The replace_hyphens method automatically replaces all hyphens and does not allow for their use for anything other than describing date ranges: https://github.com/iainbeeston/nickel/blob/master/lib/nickel/nlp_query.rb#L388-L390