calendar icon indicating copy to clipboard operation
calendar copied to clipboard

Add natural language parsing info

Open peteruithoven opened this issue 7 years ago • 3 comments

@marioguerriero added natural language parsing in the following commit: https://github.com/elementary/calendar/commit/8a2063007acd73cbecf8d5c6877aafe20ee8b214

But there is only a very subtle hint this exists and no information on "syntax". Daniel mentioned "Dancing at 7pm" as an example in: https://elementaryos.stackexchange.com/questions/9486/how-can-i-create-an-event-with-natural-language-parsing-in-calendar

Parsing is handled by ParserEn or ParserDe. I'll only focus on English for now.

Part examples

Some research / resource to come up with more practical examples. Since these are parsed by regular expressions it's hard to express all possible expressions in a easy to understand manner.

Date

  • two days ago
  • yesterday
  • today
  • tomorrow
  • this weekend
  • all day
  • the whole day
  • next week/month
    • days ago
  • in * days/weeks
  • next/on/this {weekday name}
  • this {weekday name} to {weekday name}
  • on {month name} {day}
  • on {month name} {day} {year}
  • from {day} to {day} {month name}
  • from {month name} {day} - {day}
  • in a month

time

  • at 19:00
  • at 5:02pm
  • at 7pm
  • @19:00
  • @7pm
  • from 19:00 to 20:00
  • 19:00 o'clock
  • 19:00h
  • 19h
  • for *min/h/d
  • for * minutes/hours/days/weeks

Persons

  • with {name}
  • with the {name}

Location

  • at/in {location}
  • at/in the {location}

Practical examples

  • Lecture on march 19 at 20:00 at MIT
  • Dancing at 7pm
  • Swimming lessons tomorrow with Elise
  • Dentist next tuesday
  • Paris from March 1 - 7
  • UX meeting at HQ at 10:00 tomorrow with dev team

Maybe we could show some practical examples in a information on hover over an info icon near the Title field? Or on hover over the arrow icon?

I'm afraid this won't be intuitive without interface improvements. Currently only on the first "enter" press the field is parsed and for this to work it probably needs some real time feedback. Maybe this would work better if we could move this into the Applications menu. I also think we should look for an existing language processing library, so it can handle more cases and languages.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

peteruithoven avatar Feb 12 '18 16:02 peteruithoven

Maybe we could show a popover the first time the user tries to add an event with some hints on how to use that feature.

marioguerriero avatar Mar 07 '18 09:03 marioguerriero

It might be nice to increase the width of the Title field to accommodate entering the enhanced syntax.

phase1geo avatar Aug 11 '18 16:08 phase1geo

If this is something we want to do, have a look at Fantastical for Mac and iOS. They have a great method of teaching the syntax, which isn't as obtrusive as a popover and doesn't go away after one (or any number) times. They animate feedback as you type (easier would be highlight). It would be much harder to implement than any of these, but a lot better. This would basically be a sort of syntax highlighting, but for a different grammar.

If we add a help popover, it would maybe nice nice to add a button in the text field that links to it. Like a little (i) button on the trailing edge.

mcclurgm avatar May 21 '20 02:05 mcclurgm