Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve parsing for add and schedule #202

Closed
rachx opened this issue Nov 5, 2016 · 8 comments
Closed

Improve parsing for add and schedule #202

rachx opened this issue Nov 5, 2016 · 8 comments

Comments

@rachx
Copy link

rachx commented Nov 5, 2016

Initially, I wanted to reject other formats other than

  1. add a task name
  2. add do something by (time)
  3. add attend something from (time) to (time)
    so things like
  4. add read something to (time) will fail but the problem is natty reads number as time (so it does not help when we try to add back to the title string)
    This fails:add i have alot of things to do for 2103

What we can do

  1. acknowledge that it will be wrong. provide ways to overcome it e.g. don't parse what is enclosed in inverted commas etc
  2. check for a) by or b) from+to otherwise c) add everything to the task string. No throwing incorrect command format.
  3. Make it compulsory to use /by or -by instead

comment here or update user guide on implementation

@burnflare
Copy link

I like option 2. Here's what we can do:

Either of these criteria must be true:

  • command has both from && to
  • command has one by

If either of them are not true, we take the entire command as a name string

@rachx
Copy link
Author

rachx commented Nov 5, 2016

Remember to add it back to the task string. Usually we don't and we shouldn't if it can be parsed as a date time

@burnflare
Copy link

burnflare commented Nov 5, 2016

I found out why the use case wasn't working!

The parser takes the input do for 2103 and returns a DateTime object for today 9:03pm. That's why it's failing.

@burnflare
Copy link

Wait never mind, this is what you already said originally

@burnflare burnflare mentioned this issue Nov 5, 2016
@rachx
Copy link
Author

rachx commented Nov 5, 2016

and nothing will fix add copy notes from cs2101 to cs2103.
natty think it is 2 years

@rachx
Copy link
Author

rachx commented Nov 5, 2016

i think just accept that there is an error. but there must be a way for the user to input add "copy notes from cs2101 to cs2103". like don't read between inverted commas.

@burnflare
Copy link

Will do. Working on "" support

@rachx
Copy link
Author

rachx commented Nov 5, 2016

can normal tasks have inverted commas in their name then? some of our screenshots have a task: return "Animal Farm". might need to change afterwards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants