elementary / elementary/calendar

Add natural language parsing info

Open
#219 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Vala
Stars
136
Forks
42
Avg merge
8h 33m
Merged PRs (30d)
3

Description

@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](https://github.com/elementary/calendar/blob/master/src/EventParser/Parsers/ParserEn.vala) or [ParserDe](https://github.com/elementary/calendar/blob/master/src/EventParser/Parsers/ParserDe.vala). 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!](https://www.bountysource.com/issues/54955614-add-natural-language-parsing-info?utm_campaign=plugin&utm_content=tracker%2F60388692&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F60388692&utm_medium=issues&utm_source=github).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.