mitcho Michael 芳貴 Erlewine

Postdoctoral fellow, McGill Linguistics.

blog

Introducing Smartdate

I recently have been working on a WordPress plugin called WP-Smartdate and I’m happy to say that it is hosted at wordpress.org starting today. As some people have noticed, my blog recently has included little links on word like “yesterday,” with a machine readable version of the date reference (called a “microformat” in the biz). Download the plugin and get started!

WP-Smartdate 0.1
4 kb - zip

This blog post describes release 0.1… For the latest description, check out the WP-Smartdate plugin page or mitcho.com/code.

Please comment! I would love to hear your feedback on the plugin.

Description

WP-Smartdate looks for relative date expressions in your blog posts, such as “tomorrow,” “this coming Monday,” “last Friday,” and adds the date reference (like “2007-11-26”) as a machine-readable microformat.

Why Smartdate?

WP-Smartdate was created for three simple audiences:

  1. For the machine: While many professional information retrieval algorithms go far beyond the scope of this program, smartdate helps the process along by adding machine-readable tags to relative date expressions.1 In addition, these machine tags, in turn, help the human: a search on Google for “November 7th, 2007,” for example, will not pull up a document talking about “yesterday,” written on the 8th, but it will pull up the smartdate output of 2007-11-07.
  2. For the human reader: Blog posts are often written in the “now,” using relative time expressions without concern for how the text will be read in the future. WP-Smartdate makes such posts easier to read and comprehend temporally2.
  3. For me: Because I think this sort of thing is fun!

A typology of smartdate date expressions

The following types of expressions are resolved with respect to the speech time—in WP-Smartdate’s case, the blog post date.

  1. simple references: “yesterday,” “today,” “tomorrow,”
  2. next/last DOTW expressions: “next Friday,” “this past Sunday,” “this Monday”

For the future

  • static dates: “January 1st, 2007”
  • duration shift expressions: “5 days ago,” “fourscore and seven years ago”
  • day of the week shifts: “2 Fridays ago”
  • clean up the code!

  1. One could argue that relative dates are a perfect place to use the abbr tag, as they are a sort of natural-language shortcut for more static temporal expressions. In fact, WP-Smartdate’s output also follows the datetime microformat design pattern draft with two caveats: 1. Unfortunately, the datetime semantic class has not yet been set as the standard is a draft. WP-Smartdate uses datetime. See the Date and Time datatype proposal for more information. 2. The current recommendation for datetime pushes for following the W3C datetime profile, which does not support the ISO-8601 time interval specification, which is will be used by WP-Smartdate. 

  2. Even though the abbr tag should only be used for machine reading

Tags: , , , ,

If you enjoyed this post, make sure you subscribe to my RSS feed (optionally with tweets from my Twitter)!

  • Bailey
    • …dot-dot-dot underneath~

    Also, I did forget to tell you I’m very impressed.

  • Pingback: mitcho.com > blog > Modifiying WordPress plugin activation behavior()

  • jane

    Reminds me of my first year Mandarin project where I made up a story about my pirate alter ego pretty much for the sole purpose of declaring that she's 22 years old and getting to point somewhere on a map and say "She lives here!" links of london links of london

  • http://www.zeekcash.com Zeek Rewards

    Dates huh. Can you show an example of how converting these words to dates helps with improving content?