From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3C865431FC0 for ; Sun, 19 Feb 2012 14:56:01 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bm7w7f1ULuIj for ; Sun, 19 Feb 2012 14:55:59 -0800 (PST) Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id EB30C431FAE for ; Sun, 19 Feb 2012 14:55:58 -0800 (PST) Received: by lahd3 with SMTP id d3so5943891lah.26 for ; Sun, 19 Feb 2012 14:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of jani@nikula.org designates 10.152.123.68 as permitted sender) client-ip=10.152.123.68; Authentication-Results: mr.google.com; spf=pass (google.com: domain of jani@nikula.org designates 10.152.123.68 as permitted sender) smtp.mail=jani@nikula.org Received: from mr.google.com ([10.152.123.68]) by 10.152.123.68 with SMTP id ly4mr13451530lab.13.1329692156079 (num_hops = 1); Sun, 19 Feb 2012 14:55:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.123.68 with SMTP id ly4mr11259344lab.13.1329692156005; Sun, 19 Feb 2012 14:55:56 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi. [84.248.80.253]) by mx.google.com with ESMTPS id s6sm21422411lbl.12.2012.02.19.14.55.53 (version=SSLv3 cipher=OTHER); Sun, 19 Feb 2012 14:55:55 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [RFC PATCH 0/2] natural language date range search Date: Mon, 20 Feb 2012 00:55:50 +0200 Message-Id: X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQnqnbkFb8zcSyIAhNbqZytTytjqIYUPuaTr+rvqqtLw7vMLyJ9uOFKQ9XGepPuRXwsmXFA1 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2012 22:56:01 -0000 Hi all, these patches add support for natural language date range search of the form date:since..until, where since and until can be fairly free form date/time expressions in English. Examples: date:two-days..yesterday (all mail in the two days before today) date:12h.. (all mail since 12 hrs ago) date:november..november (all mail in previous november) date:2011.. (all mail since the beginning of 2011) date:last-week..this-week (all mail over last and current week) date:5/10/2011-12:34:55..10pm_2012-01-14 Plus plenty more and combinations of the above. The repository for the date/time parser with a command line tool is at [1], and there's a README [2] with a bunch of details too. BR, Jani. [1] https://gitorious.org/parse-time-string/parse-time-string [2] https://gitorious.org/parse-time-string/parse-time-string/blobs/master/README Jani Nikula (2): lib: add date/time parser lib: add date range search lib/Makefile.local | 2 + lib/database-private.h | 1 + lib/database.cc | 4 + lib/getdate-proc.cc | 34 ++ lib/getdate-proc.h | 21 + lib/parse-time-string.c | 1304 +++++++++++++++++++++++++++++++++++++++++++++++ lib/parse-time-string.h | 95 ++++ 7 files changed, 1461 insertions(+), 0 deletions(-) create mode 100644 lib/getdate-proc.cc create mode 100644 lib/getdate-proc.h create mode 100644 lib/parse-time-string.c create mode 100644 lib/parse-time-string.h -- 1.7.5.4