GNOME Bugzilla – Bug 555680
Extend natural language date assignment.
Last modified: 2010-03-31 03:07:04 UTC
When you create a new task, you can assign a due date using natural language, or an actual date. For natural language, only "today" and "tomorrow" seem to work. Adding things like recognition of the days of the week (Monday, this Monday, next Monday), periods of time (in two weeks) and also supporting recurring items the same way (repeat monthly, every two weeks) would enhance this and make it a more complete feature.
Yup, this would be great, "today" and "tomorrow" was just a quick start. Ross Burton added a fair bit of NLP to Pimlico Tasks; we should look at the regular expressions he used. My original inspiration was RTM's gmail extension for Firefox, so I highly recommend playing with that one, too. Patches welcome, just keep translations in mind. This is definitely something we'll improve eventually.
Created attachment 131493 [details] [review] Improves date parsing, natural language date parsing. I think some of my MD config to workaround the build issues might've snuck into the diff, you should be careful while patching it.
Hi, I added support for the following features: 1. Accepting weekday names, along with the "next" modifier to push it to the next week. 2. Better way to put in dates, for example if I put in 14th, it looks for the nearest 14th. You can also say 14th april, march, etc. It even makes sure that if it's december and you allocate january, it puts the date in the nearest january in the future. 3. Support for "time descriptors" for example, if the input is "Bug reports due next monday", it makes the task string only "bug reports", and the date is allocated correctly. Some testcases: Original Task string: "GSoC Proposals due before 3rd april" The Task is:"GSoC Proposals due" and the due 4/3/2009 4:20:19 PM Original Task string: "Lab reports due on monday" The Task is:"Lab reports due" and the due 3/30/2009 4:20:19 PM Original Task string: "Date at 8PM this saturday" The Task is:"Date at 8PM" and the due 3/28/2009 4:20:19 PM Original Task string: "New years' on January 1st" The Task is:"New years'" and the due 1/1/2010 4:20:19 PM Original Task string: "Study solid state pysics on tuesday" The Task is:"Study solid state pysics" and the due 3/31/2009 4:20:19 PM Original Task string: "Solid state physics test next tuesday" The Task is:"Solid state physics test" and the due 4/7/2009 4:20:19 PM Original Task string: "April fools' on 1st" The Task is:"April fools'" and the due 4/1/2009 4:20:19 PM Original Task string: "Friend's birthday on Feb 5th" The Task is:"Friend's birthday" and the due 2/5/2010 4:20:19 PM I'm attaching a patch to make these changes. This is my first attempt at writing C# ever, so please review my code. Thanks.
Created attachment 143542 [details] [review] Natural days and dates Cleaned up the patch, it applies cleanly for me with the latest git sources. Tested on Ubuntu 9.04, with the following tests: Day ----- # Specific day of the week Test day of week task on monday # Specific short name day of the week Test short name day of the week task on tues # One week in the future Test next week task next monday # The current day, so put it one week in the future Test confusing day task sunday Date ------ # Specific full month name test Test long month task November 10th # Specific short month name test Test short month name task due Nov 1st # Over a year away from the current date test Long period of time test task on january 15 2020 # over a year. # Implied month test - date later in month Implied month test task due 25th # Implied month test - date is next month Implied over a month boundary test task 5th Note: It doesn't handle this type of date format: Test lack of 'rd, 'st' or 'th' task on November 1 So you'll get a task of: Test lack of 'rd, 'st' or 'th' task on Backends tested: Localfile EDS Rememberthemilk
This needs some coding standards cleanup and some strings marked translatable, working on it now.
Sorry for the delay, but some of this needs to be reworked because right now it's very english-centric. Nothing too big, just some regular expression merges/changes I think.
Sandy - do you want to point me at the coding standard the patches' not following, or give me a pointer on those issues and I can clean that up? Think I can work out the translation piece, there's good info: http://www.mono-project.com/I18N_with_Mono.Unix Not sure what you're thinking on the regular expressions? (In reply to comment #6) > Sorry for the delay, but some of this needs to be reworked because right now > it's very english-centric. Nothing too big, just some regular expression > merges/changes I think.
Committed an inspired patch by the work done by Anirudh and Steve. It should work in all languages. master 601bda4