<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mitcho.com &#187; ubiquity</title>
	<atom:link href="http://mitcho.com/blog/tag/ubiquity/feed/" rel="self" type="application/rss+xml" />
	<link>http://mitcho.com</link>
	<description></description>
	<lastBuildDate>Tue, 31 Aug 2010 23:03:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Jetpack Ambassadors in MV</title>
		<link>http://mitcho.com/blog/projects/jetpack-ambassadors-in-mv/</link>
		<comments>http://mitcho.com/blog/projects/jetpack-ambassadors-in-mv/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 20:55:23 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[travelogue]]></category>
		<category><![CDATA[California]]></category>
		<category><![CDATA[Jetpack]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3371</guid>
		<description><![CDATA[A couple weeks ago I went out to Mozilla HQ in Mountain View for a Jetpack Ambassador meetup. Jetpack is a project at Mozilla labs intended to make writing Firefox add-ons easier, and shares some ancestry with the Ubiquity project dear to my heart. The Jetpack Ambassadors are a team of Mozilla community members who [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/link/contribute-to-ubiquity-no-coding-required/' rel='bookmark' title='Permanent Link: Contribute to Ubiquity! No Coding Required!'>Contribute to Ubiquity! No Coding Required!</a></li>
<li><a href='http://mitcho.com/blog/projects/spring-is-for-speaking/' rel='bookmark' title='Permanent Link: Spring is for Speaking: JSConf, WordCamp SF, IACL'>Spring is for Speaking: JSConf, WordCamp SF, IACL</a></li>
<li><a href='http://mitcho.com/blog/how-to/develop-with-jetpack-sdk-0-2/' rel='bookmark' title='Permanent Link: Beginning development with Jetpack SDK 0.2'>Beginning development with Jetpack SDK 0.2</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago I went out to Mozilla HQ in Mountain View for a Jetpack Ambassador meetup. <a href="http://mozillalabs.com/jetpack">Jetpack</a> is a project at <a href="http://mozillalabs.com">Mozilla labs</a> intended to make writing Firefox add-ons easier, and shares some ancestry with the Ubiquity project dear to my heart. The <a href="http://upload.wikimedia.org/wikipedia/en/c/c0/Super_Friends.jpg">Jetpack Ambassadors</a> are a team of Mozilla community members who will be involved with Jetpack marketing, evangelizing Jetpack and writing about our own experiences working with the exciting new Jetpack architecture.</p>

<p>We spent a good chunk of time with a team from <a href="http://www.ielephant.com/">Invisible Elephant</a> who came in to give us some training on making technical presentations, and then dug into the code on Day 2. It was great to have the geniuses at Mozilla Labs like Atul and Myk show us the latest Jetpack code as well as get the latest project direction from Daniel, Aza, and Nick, from which we could see the amount of careful consideration and effort that&#8217;s gone into <a href="https://wiki.mozilla.org/Labs/Jetpack/Reboot">the Jetpack reboot</a>.</p>

<p><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack45.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack45.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack47.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack47.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack59.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack59.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack67.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack67.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack64.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack64.jpg' /></a></p>

<p>The best part of the whole experience, though, has to be the fellowship with the other Jetpack Ambassadors. The Ambassadors came from all over the world, encompassing Europe, Asia, S. America, and of course N. America. Each are involved with some really exciting projects and have each made a name for themselves in their respective communities. I&#8217;ve put together <a href="http://twitter.com/mitchoyoshitaka/jetpack">a twitter list</a> of all the Jetpack Ambassadors and the core team members and invite you to follow them.</p>

<p><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack05.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack05.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack08.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack08.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack17.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack17.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack20.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack20.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack24.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack24.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack36.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack36.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack38.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack38.jpg' /></a><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack40.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack40.jpg' /></a></p>

<p>We also had the greatest number of <a href="http://mozillalabs.com/ubiquity/">Ubiquity</a> core developers to have ever been in the same place at the same time, which of course had to be documented. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><a rel='lightbox[jetpack-ambassadors-in-mv]' href='http://mitcho.com/photos/travel/jetpack2010/image/1000/jetpack63.jpg' alt='zenphoto image'><img class='images' src='http://mitcho.com/photos/travel/jetpack2010/image/thumb/jetpack63.jpg' /></a></p>

<p>(More photos can be seen in <a href="http://mitcho.com/photos/travel/jetpack2010/">my gallery</a>.)</p>

<p>I had a fantastic time in MV and it was a shame I could only be there for such a short time. I feel honored to be a part of this group and am looking forward to speaking on Jetpack soon <a href="http://javascript.meetup.com/2/calendar/11536445/">at an event near you</a>!</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/link/contribute-to-ubiquity-no-coding-required/' rel='bookmark' title='Permanent Link: Contribute to Ubiquity! No Coding Required!'>Contribute to Ubiquity! No Coding Required!</a></li>
<li><a href='http://mitcho.com/blog/projects/spring-is-for-speaking/' rel='bookmark' title='Permanent Link: Spring is for Speaking: JSConf, WordCamp SF, IACL'>Spring is for Speaking: JSConf, WordCamp SF, IACL</a></li>
<li><a href='http://mitcho.com/blog/how-to/develop-with-jetpack-sdk-0-2/' rel='bookmark' title='Permanent Link: Beginning development with Jetpack SDK 0.2'>Beginning development with Jetpack SDK 0.2</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/jetpack-ambassadors-in-mv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mashing up the browser in Maine</title>
		<link>http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/</link>
		<comments>http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 19:00:32 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[travelogue]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jetpack]]></category>
		<category><![CDATA[Maine]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3233</guid>
		<description><![CDATA[Last week I was invited to give a talk at the TechMaine annual conference in Portland, Maine. Being a longer time slot than I previously have used to talk about Ubiquity, I decided to dedicate a good portion of the talk to Jetpack. Being outside of Mozilla for the past few months, this gave me [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Permanent Link: Jetpacking in Boston'>Jetpacking in Boston</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpack-ambassadors-in-mv/' rel='bookmark' title='Permanent Link: Jetpack Ambassadors in MV'>Jetpack Ambassadors in MV</a></li>
<li><a href='http://mitcho.com/blog/projects/spring-is-for-speaking/' rel='bookmark' title='Permanent Link: Spring is for Speaking: JSConf, WordCamp SF, IACL'>Spring is for Speaking: JSConf, WordCamp SF, IACL</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Last week I was invited to give a talk at the <a href="http://www.techmaine.com/ac2009">TechMaine annual conference</a> in Portland, Maine.</p>

<p>Being a longer time slot than I previously have used to talk about Ubiquity, I decided to dedicate a good portion of the talk to <a href="http://jetpack.mozillalabs.com">Jetpack</a>. Being outside of Mozilla for the past few months, this gave me an opportunity to get reacquainted with the Jetpack APIs. I myself was impressed by how easy it was to develop a quick Jetpack. I ended up preparing two to live-code during the talk: one called <a href="http://jetpackgallery.mozillalabs.com/jetpacks/207">Helvetica</a> which, with one click, replaces all fonts on the current page with Helvetica; and <a href="http://jetpackgallery.mozillalabs.com/jetpacks/208">You Are Here</a> which uses an open API from <a href="http://ipinfodb.com/">IPinfoDB</a> to display the physical location of the domain you are currently visiting in the status bar. Both are now on the <a href="http://jetpackgallery.mozillalabs.com/">Jetpack Gallery</a>.</p>

<p><a rel='lightbox' href="http://mitcho.com/blog/wp-content/uploads/2009/12/youarehere.png"><img src="http://mitcho.com/blog/wp-content/uploads/2009/12/youarehere-inset.png" alt="" title="You Are Here" width="464" height="112" class="alignnone size-full wp-image-3237" /></a></p>

<p>Unfortunately there was a bit of a snowstorm leading up to the event, but there was still a nice turnout and I got to meet some fantastic people there. Ken Shoemake of <a href="http://en.wikipedia.org/wiki/slerp">slerp</a> and <a href="http://en.wikipedia.org/wiki/quaternion">quaternion</a> fame came up to me after my talk and said &#8220;the Ubiquity parser reminded me of the dancing bear&#8230; it&#8217;s less surprising that it works well as that it works at all.&#8221; <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I also enjoyed the other great presentations in the technology track, covering the <a href="http://www.nofluffjuststuff.com/conference/speaker/brian_sletten">virtues of REST</a> and basic iPhone development.</p>

<p><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/mitcho/mashup-the-browser-with-ubiquity-and-jetpack" title="Mashup the Browser with Ubiquity and Jetpack">Mashup the Browser with Ubiquity and Jetpack</a><object style="margin:0px" width="600" height="501"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=techmaine-091210174736-phpapp01&#038;stripped_title=mashup-the-browser-with-ubiquity-and-jetpack" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=techmaine-091210174736-phpapp01&#038;stripped_title=mashup-the-browser-with-ubiquity-and-jetpack" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="501"></embed></object></p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Permanent Link: Jetpacking in Boston'>Jetpacking in Boston</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpack-ambassadors-in-mv/' rel='bookmark' title='Permanent Link: Jetpack Ambassadors in MV'>Jetpack Ambassadors in MV</a></li>
<li><a href='http://mitcho.com/blog/projects/spring-is-for-speaking/' rel='bookmark' title='Permanent Link: Spring is for Speaking: JSConf, WordCamp SF, IACL'>Spring is for Speaking: JSConf, WordCamp SF, IACL</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mozilla By The Numbers</title>
		<link>http://mitcho.com/blog/projects/mozilla-by-the-numbers/</link>
		<comments>http://mitcho.com/blog/projects/mozilla-by-the-numbers/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 04:26:54 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[observation]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2844</guid>
		<description><![CDATA[About six months ago I started working for Mozilla Labs full-time, focusing on Ubiquity, the multilingual natural language interface for the browser. This week marked my last week on contract as I go back to grad school next week. While the work will go on and I hope to continue to stay involved as time [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/jetpack-ambassadors-in-mv/' rel='bookmark' title='Permanent Link: Jetpack Ambassadors in MV'>Jetpack Ambassadors in MV</a></li>
<li><a href='http://mitcho.com/blog/life/report-from-mozilla-party-jp-10/' rel='bookmark' title='Permanent Link: Report from Mozilla Party JP 10!'>Report from Mozilla Party JP 10!</a></li>
<li><a href='http://mitcho.com/blog/projects/this-week-on-ubiquity-parser-the-next-generation/' rel='bookmark' title='Permanent Link: This week on Ubiquity Parser: The Next Generation'>This week on Ubiquity Parser: The Next Generation</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>About six months ago <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">I started working</a> for Mozilla Labs full-time, focusing on <a href="http://ubiquity.mozilla.com">Ubiquity</a>, the multilingual natural language interface for the browser. This week marked my last week on contract as I go back to <a href="http://web.mit.edu/linguistics/">grad school</a> next week. While the work will go on and I hope to continue to stay involved as time allows, here&#8217;s a quick bird&#8217;s eye view of my activities in my Mozilla tenure:</p>

<hr/>

<p>Time working for Mozilla: 6.5 months</p>

<p>Mozilla-related blog posts written: <a href="http://mitcho.com/blog/tag/mozilla-planet">69</a></p>

<p>Academic papers written on Ubiquity: <a href="http://mitcho.com/academic/erlewine-sigir.pdf">1</a></p>

<p>Ubiquity presentations given: <a href="http://www.slideshare.net/mitcho">5</a></p>

<p>Screencasts made: <a href="http://vimeo.com/mitchoyoshitaka/videos">8</a></p>

<p>Most popular video on Vimeo: <a href="http://vimeo.com/5420966">Ubiquity 0.5 日本語紹介ビデオ</a>, the Japanese Ubiquity 0.5 introduction video: 2252 views</p>

<p>Languages Ubiquity commands and parser now support: 6</p>

<p>Commits to the <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/">Ubiquity repository</a>: 492</p>

<p>Other web projects started during this period: 2+ (<a href="http://tengrandisburiedthere.com">Ten Grand Is Buried There</a>, <a href="http://mitcho.com/code/hookpress/">HookPress</a>)</p>

<p>TechCrunch references: 2 (<a href="http://www.techcrunch.com/2009/06/10/geeksonaplane-meet-tokyo-20-learn-about-the-relation-between-the-web-language/">1</a>, <a href="http://www.techcrunch.com/2009/06/18/mozilla-shows-microsoft-where-10000-is-buried/">2</a>)</p>

<p>Countries worked in: 2</p>

<p>Mythical Kiwis worked with: <a href="http://theunfocused.net/">1</a></p>

<p>References to bugs I introduced as &#8220;glitcho&#8221;s: <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/79d40b35ea2b">1</a></p>

<p>Extremely disturbing homages to me and <a href="http://dl-client.getdropbox.com/u/10320/django/wallpaper/magic-pony-django-wallpaper.png">Django</a>: <a href="http://users.skumleren.net/cers/mitchopony.png">1</a></p>

<p>Friends made; experience gained; lessons on Open-ness learned; personal growth: <strike>priceless</strike> enumerable</p>

<hr/>

<p>Thanks to all who made this experience amazing, beginning with Aza, Jono, Atul, Blair and the rest of the Labs team; intern extraordinaire Brandon; the always thoughtful and friendly <a href="http://mozilla.jp">Mozilla Japan team</a>; and of course the <a href="http://groups.google.com/group/ubiquity-firefox">fantastic Ubiquity community</a>! Please visit me in Boston—I should be around for a while. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/jetpack-ambassadors-in-mv/' rel='bookmark' title='Permanent Link: Jetpack Ambassadors in MV'>Jetpack Ambassadors in MV</a></li>
<li><a href='http://mitcho.com/blog/life/report-from-mozilla-party-jp-10/' rel='bookmark' title='Permanent Link: Report from Mozilla Party JP 10!'>Report from Mozilla Party JP 10!</a></li>
<li><a href='http://mitcho.com/blog/projects/this-week-on-ubiquity-parser-the-next-generation/' rel='bookmark' title='Permanent Link: This week on Ubiquity Parser: The Next Generation'>This week on Ubiquity Parser: The Next Generation</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/mozilla-by-the-numbers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Aliens Aliases Have Landed</title>
		<link>http://mitcho.com/blog/projects/the-aliens-aliases-have-landed/</link>
		<comments>http://mitcho.com/blog/projects/the-aliens-aliases-have-landed/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 00:46:56 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[verb]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2841</guid>
		<description><![CDATA[This week I implemented a new way to customize and extend Ubiquity commands: CmdUtils.CreateAlias. The use case for and importance of CreateAlias CreateAlias lets you easily create a special-case alias of another, more generic verb. Ubiquity comes bundled with useful verbs like translate and search which can be used for a number of different uses [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Permanent Link: Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
<li><a href='http://mitcho.com/blog/projects/rolling-out-the-roles/' rel='bookmark' title='Permanent Link: Rolling out the Roles'>Rolling out the Roles</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/09/close-encounters.jpg" alt="close-encounters.jpg" border="0" width="640" height="300" /></p>

<p>This week <a href="http://ubiquity.mozilla.com/trac/ticket/201">I implemented</a> a new way to customize and extend Ubiquity commands: <code>CmdUtils.CreateAlias</code>.</p>

<h3>The use case for and importance of <code>CreateAlias</code></h3>

<p><code>CreateAlias</code> lets you easily create a special-case alias of another, more generic verb. Ubiquity comes bundled with useful verbs like <code>translate</code> and <code>search</code> which can be used for a number of different uses based on their arguments. In some cases, and in some languages, though, typing out <code>translate to English</code> or <code>search with Google</code> is <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">unnatural</a>, though, as there is a more succinct and direct way to make that request. For example, in English one could say &#8220;anglicize&#8221; or &#8220;google&#8221;, respectively, for the verbs and arguments above. Indeed, in order to support both <code>search with Google</code> and <code>google</code>, Ubiquity traditionally has implemented two different verbs, <code>search</code> and <code>google</code>, which duplicate functionality and code.</p>

<p><code>CreateAlias</code> lets us create such natural aliases <a href="http://en.wikipedia.org/wiki/Don&#8217;t_repeat_yourself">without repeating ourselves</a>. We can easily create an <code>anglicize</code> verb which, in one word, does the work of <code>translate to English</code>, or <code>google</code> which is semantically equivalent to <code>search with Google</code>.</p>

<p>These sorts of aliases become particularly important in our perpetual quest to internationalize Ubiquity. One discussion that came up early on on our <a href="http://groups.google.com/group/ubiquity-i18n">Ubiquity-i18n</a> list is the fact that not all languages have the verb &#8220;Google&#8221;: in many languages it is necessary to explicitly say &#8220;search with Google&#8221;. Moreover, other languages may have other domain-specific verbs which English doesn&#8217;t have either. Maybe some language has a special verb for &#8220;email with Hotmail&#8221; or &#8220;map Denmark&#8221;. Who knows? With <code>CreateAlias</code> we can easily enable such localizations based on the more generic commands bundled with Ubiquity.</p>

<h3>Creating an alias</h3>

<p><code>CreateAlias</code> was designed to be incredibly simple to use. Here&#8217;s an example that will be bundled (but not installed by default) in Ubiquity:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">CmdUtils.<span style="color: #660066;">CreateAlias</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  names<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;anglicize&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
  verb<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;translate&quot;</span><span style="color: #339933;">,</span>
  givenArgs<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> goal<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;English&quot;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<p>As you see, this syntax is incredibly straightforward. There are two required properties, <code>names</code>, an array of names for the alias, and <code>verb</code>, a reference to the target verb that this alias should use.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>The alias can also have a <code>givenArgs</code> property which is a hash of pre-specified arguments with their <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2/Semantic_Roles">semantic roles</a>. Because <code>translate</code> takes three arguments (an <code>object</code> text, a <code>goal</code> language, and a <code>source</code> language) but we have pre-specified a <code>goal</code> in the <code>givenArgs</code>, the new <code>anglicize</code> command will only take two arguments: the <code>object</code> text and a <code>source</code> language. Of course, if you specify no <code>givenArgs</code>, you&#8217;ll get a simple synonym without having access to the original verb&#8217;s code.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/09/anglicize1.png" alt="anglicize.png" border="0" width="650" height="152" /></p>

<p>As you see, the preview of this command is simply the preview of the <code>translate</code> verb. Its preview and execution is just as if you had entered <code>translate こんにちは to English</code>.</p>

<p>Just like other commands created with <code>CreateCommand</code>, the object specifying the alias can also have properties like <code>help</code>, <code>description</code>, <code>author</code> information, and so on. I used the <code>icon</code> property to add a <a href="http://en.wikipedia.org/wiki/Union Jack">Union Jack</a> to it so that it was easily identifiable.</p>

<h3>Bonus: using <code>CmdUtils.previewCommand</code> and <code>CmdUtils.executeCommand</code></h3>

<p>On the road to implementing <code>CreateAlias</code>, I also implemented the <code>CmdUtils.previewCommand</code> and <code>CmdUtils.executeCommand</code> functions. The majority of this code comes from previous work by <a href="http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/993411167fc6f165">Louis-Rémi Babé</a>, though I adapted it to the modern Ubiquity system. Using <code>previewCommand</code> and <code>executeCommand</code> you can take advantage of the preview or execute functionality of another command. In the new <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/raw-file/tip/ubiquity/standard-feeds/alias-commands.js">alias-commands</a> feed I included a command called <code>germanize</code> which essentially is a straightforward analogy to <code>anglicize</code>, seen above, but using these functions within a <code>CreateCommand</code>. While <code>CreateAlias</code> is much more straightforward for simple aliases, for more complex subcommands where you would like to adapt another verb&#8217;s execution or preview, or only take one of those but re-implement the other part, <code>previewCommand</code> and <code>executeCommand</code> are the way to go.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>The <code>verb</code> reference can be the canonical or <em>reference name</em> of a command, which is the first name in the <code>names</code> of a command (also the name listed in the command list when Ubiquity is running in English) or the actual internal ID of the command, which looks like <code>resource://ubiquity/standard-feeds/general.html#translate</code>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Permanent Link: Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
<li><a href='http://mitcho.com/blog/projects/rolling-out-the-roles/' rel='bookmark' title='Permanent Link: Rolling out the Roles'>Rolling out the Roles</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/the-aliens-aliases-have-landed/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Exploring Command Chaining in Ubiquity: Part 2</title>
		<link>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/</link>
		<comments>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 23:14:07 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[Chinese]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Japanese language]]></category>
		<category><![CDATA[Mandarin]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[natural syntax]]></category>
		<category><![CDATA[serial verb construction]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2799</guid>
		<description><![CDATA[Introduction I recently have begun giving serious thought to what command chaining might look like in Ubiquity and the various considerations which must be made to make it happen. The &#8220;command chaining,&#8221; or &#8220;piping,&#8221; described here always involves (at least) two verbs acting sequentially on a passed target—that is, the first command performs some action [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Permanent Link: Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Permanent Link: Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/link/ubiquity-in-italian/' rel='bookmark' title='Permanent Link: Ubiquity in Italian'>Ubiquity in Italian</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>

<p>I recently have begun giving serious thought to what <strong>command chaining</strong> might look like in Ubiquity and the various considerations which must be made to make it happen. The &#8220;command chaining,&#8221; or &#8220;piping,&#8221; described here always involves (at least) two verbs acting sequentially on a passed target—that is, the first command performs some action or lookup and the second command acts on the first command&#8217;s output.</p>

<p>A few days ago I penned some initial <a href="http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/">technical considerations regarding command chaining</a>. In this post I&#8217;ll be point out some linguistic considerations involved in supporting a <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural syntax</a> for chaining.</p>

<p><span id="more-2799"></span></p>

<h3>Simple syntaxes: sequential vs embedding strategies</h3>

<p>When it comes to creating a natural language interface, there&#8217;s always a decision to make between requiring a certain kind of input, or working a little harder to understand the user&#8217;s natural input. From an implementation point of view, adopting certain programmatic conventions is of course simpler and to this end, there have been a couple different &#8220;unnatural&#8221; command chaining syntaxes suggested. While these both go against Ubiquity&#8217;s basic tenet of <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural syntax</a> — that is, to not introduce rules which contradict the user&#8217;s natural language — which gives Ubiquity its strengths of usability and memorability, I&#8217;ll entertain them here as they illustrate two different structural relationships that we will want to consider.</p>

<p><a href='http://www.threadless.com/product/543/This_is_not_a_Pipe?streetteam=mitcho'><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/not-pipe.gif" alt="not-pipe.gif" border="0" width="480" height="329" /></a></p>

<p>The first suggestion is to adopt the <a href="http://en.wikipedia.org/wiki/Pipeline_(Unix)">shell pipe</a> (|), which would lead to input such as</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ubiquity" style="font-family:monospace;">translate hello to Spanish | email to Jono</pre></td></tr></table></div>


<p>While this itself is pretty unnatural unless you speak shell, note that this syntax is similar to the more natural &#8220;, and&#8221; syntax, yielding <code>translate hello to Spanish, and email to Jono</code>, which we will consider below. I&#8217;ll refer to this strategy as the <strong>sequential</strong> strategy.</p>

<p>Another <a href="http://www.croczilla.com/blog/16">very interesting proposal</a> by Alex Fritze is to embed each subordinate computation into an argument position, marked by parentheses. This could also be parsed relatively straightforwardly by writing a noun type which first checks for parentheses and then runs the content of the argument through another <a href="http://ubiquity.mozilla.com/trac/ticket/532">ParseQuery</a>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
</pre></td><td class="code"><pre class="ubiquity" style="font-family:monospace;">email (translate hello to Spanish) to Jono</pre></td></tr></table></div>


<p>I&#8217;ll refer to this pattern as the <strong>embedding</strong> strategy.</p>

<h3>Sequential and embedding strategies in natural language</h3>

<p>What&#8217;s interesting about the two proposals above is that both strategies are seen in natural language. The sequential strategy could correspond to the following linguistic phenomena:</p>

<ol>
<li><a href="http://en.wikipedia.org/wiki/coordination (linguistics)">coordination</a>: a non-hierarchical joining of two or more <a href="http://en.wikipedia.org/wiki/clauses (linguistics)">clauses</a>, often marked by a <a href="http://en.wikipedia.org/wiki/conjunction">conjunction</a>. Here&#8217;s an example from English:

<ul>
<li>&#8220;[I made a sandwich] and [you will eat it]&#8221; where [] represent clause boundaries. Here, &#8220;and&#8221; is the conjunction.</li>
</ul></li>
<li><a href="http://en.wikipedia.org/wiki/serial verb construction">serial verb</a> and <a href="http://en.wikipedia.org/wiki/converb">converb</a> constructions: a joining of multiple verbs or verb phrases within a single clause, with shared subject and tense/aspect values, with no particular conjugation or delimiter between them. Such constructions are common in many African and east Asian languages. Here are two examples:<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup><br/></li>
</ol>

<ul><li>A converbal construction in Japanese:<br/>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
</pre></td><td class="code"><pre class="ja" style="font-family:monospace;">僕は     サンドイッチを 作って     食べる
boku-wa sandiʔchi-o  tsuku-ʔte tabe-ru
I-TOP   sandwich-ACC make-CON  eat</pre></td></tr></table></div>


<br/>&#8220;I (will) make a sandwich and eat [it].&#8221; (Here, `TOP` = topic, `ACC` = accusative, `CON` = converbal ending)[^3]</li>
<li>A serial verb construction in Mandarin Chinese:<br/>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>6
7
8
</pre></td><td class="code"><pre class="zh" style="font-family:monospace;">我 作   三明治      吃
wǒ zùo  sānmíngzhì chī
I  make sandwich   eat</pre></td></tr></table></div>


<br/>&#8220;I (will) make a sandwich and eat [it]&#8221; or &#8220;I (will) make a sandwich [in order to] eat [it].&#8221;</li></ul>

<p><br/>Note that in both the converb and serial verb construction, the second verb (eat) takes shares its object (sandwich) with the first verb and there is no need for a pronoun such as &#8220;it&#8221; to introduce that argument as it is with coordination, above.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<p>The embedding strategy is observed in natural language as well, in the form of the following phenomena:</p>

<ol>
<li><a href="http://en.wikipedia.org/wiki/embedded clauses">embedded clauses</a>: a sentence is itself the argument of another verb. Example:<br/></li>
</ol>

<ul><li>&#8220;John says [he likes sandwiches].&#8221;</li></ul>

<p><br/>Embedded clauses, however, clearly have no relation to command chaining and does not require our attention.
2. <a href="http://en.wikipedia.org/wiki/relative clauses">relative clauses</a>: a partial sentence<sup id="fnref:5"><a href="#fn:5" rel="footnote">3</a></sup> is attached to a noun in order to describe it or distinguish it from other possible referents. Example:</p>

<ul><li>&#8220;You ate the sandwich that I made&#8221; where &#8220;sandwich&#8221; is called the &#8220;head&#8221; of the relative clause, and &#8220;I made&#8221; is what I here call the &#8220;partial sentence&#8221; (see footnote). The &#8220;relative clause&#8221; is used here to distinguish &#8220;the sandwich that I made&#8221; from other sandwiches.</li></ul>

<h3>The natural syntax of chaining</h3>

<p>So <strong>which strategy is used in complex natural language commands:</strong> the sequential strategy or the embedding strategy? Both the sequential strategy and embedding strategy can be involved with commands:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9
10
</pre></td><td class="code"><pre class="en" style="font-family:monospace;">[Make a sandwich] and [eat it]!
Eat (the sandwich that I made)!</pre></td></tr></table></div>


<p>These two commands do not mean the same thing, though, and only (9) is the kind of command we would want to give Ubiquity. The problem with relative clauses, as in (10), is that it <em><a href="http://en.wikipedia.org/wiki/presupposition">presupposes</a> the existence of the sandwich in the context</em>. If we both know you just made a sandwich, saying (10) is perfectly appropriate, but out of the blue it doesn&#8217;t make sense. For this reason, <strong>only the sequential strategy is used in the natural syntax of chaining.</strong></p>

<h3>Parsing the sequential strategy</h3>

<p>In natural language, unlike the initial simple proposals laid out above, there is often no clear delimiter marking the boundary between the two parts in a sequential relation (e.g. examples (3) and (6) above, particularly given that neither Japanese and Chinese normally break words with spaces). <strong>How would we parse a sequential string of commands?</strong></p>

<p>Let&#8217;s assume for our purposes here that we can identify find all verbs within the input string.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> Parsing a sequential strategy string is not particularly difficult if we can also assume that the verb in any particular language is either always verb-initial or always verb-final. Let&#8217;s look at both cases:</p>

<ul>
<li>Always verb-initial: Mandarin Chinese:<br/></li>
</ul>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
12
13
</pre></td><td class="code"><pre class="zh" style="font-family:monospace;">翻譯       hello 到  西班牙語   送    給  Juanito
fānyì     hello dào xībānyáyǔ sòng gěi Juanito
translate hello to  Spanish   send to  Juanito</pre></td></tr></table></div>


<p><br/>
&#8220;Translate hello to Spanish [and] send [it] to Juanito&#8221;
  1. find every possible verb:<br/><strong>翻譯</strong>hello到西班牙語<strong>送</strong>給Juanito
  2. as every verb marks the beginning of a sentence, we now have our two commands: &#8220;<strong>翻譯</strong>hello到西班牙語&#8221; (translate hello to Spanish) and &#8220;<strong>送</strong>給Juanito&#8221; (send to Juanito).
* Always verb-final: Japanese<br/></p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>14
15
16
</pre></td><td class="code"><pre class="ja" style="font-family:monospace;">helloを スペイン語に 訳して Juanitoに 送って
hello-o supeingo-ni yakus-ite Juanito-ni oku-ʔte
hello-ACC Spanish-DAT translate-CON Juanito-DAT send-CON</pre></td></tr></table></div>


<p><br/>
&#8220;Translate hello to Spanish [and] send [it] to Juanito&#8221;
  1. find every possible verb:<br/>helloをスペイン語に<strong>訳して</strong>Juanitoに<strong>送って</strong>
  2. as every verb marks the end of a sentence, we now have our two commands: &#8220;helloをスペイン語に<strong>訳して</strong>&#8221; (translate hello to Spanish) and &#8220;Juanitoに<strong>送って</strong>&#8221; (send to Juanito).</p>

<p>For languages where there is a clear conjunction between the two commands, such as English &#8220;and&#8221;, we can also use that conjunction as a delimiter as well. We then simply execute the first command and then execute the second with the first command&#8217;s output in its interpolation context. This way the output of the first command will be picked up both by an overt pronoun such as &#8220;it&#8221; in the second command and without it, such as in the Chinese and Japanese examples above.<sup id="fnref:6"><a href="#fn:6" rel="footnote">5</a></sup></p>

<p>The only potential problem with this approach is in the case of languages where some commands are verb-initial while others are verb-final. I note that such languages do exist in a previous blog post, <a href="http://mitcho.com/blog/observation/wheres-the-verb/">Where&#8217;s The Verb</a>. In these languages, commands can be expressed by more than one verb form (such as infinitive, imperative, subjunctive, etc.) and some of those verb forms are sentence-initial while others are sentence-final. Here&#8217;s one such example from German:</p>

<p>&#8220;search hello with google&#8221; (German)
1. Infinitive: hello mit google suchen
2. Imperative: suche hello mit google</p>

<p>Here the verb for &#8220;search&#8221; is &#8220;suchen&#8221; (infinitive) or &#8220;suche&#8221; (imperative). I know that this same type of phenomena occurs in other Germanic languages such as Dutch with infinitive and imperative and also other languages such as Modern Greek with infinitive and subjunctive forms. <strong>If you are a speaker of one of these lanuages (German, Dutch, Greek, etc.) I would love to know whether you can chain verb-final and verb-initial commands together.</strong></p>

<h3>Conclusion</h3>

<p>In this blog post I examined command chaining in natural language, focusing on data from English, Mandarin Chinese, and Japanese, which exhibit three linguistically different approaches to chaining. What we found is that the sequential strategy—that of listing the commands one by one, in order of execution—is what is used in natural languages, rather than any sort of embedding. This fact, combined with the fact that our parser can recognize every available verb, offers a simple approach to doing a naive parse of natural command chains in most languages, even without explicit delimiters.</p>

<p>In a final installation of this series on &#8220;exploring command chaining,&#8221; I hope to consider how the Ubiquity interface itself could present command chains and aid in its input.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>The distinction between serial verb and converb constructions (as well as other forms of complex predication) hinge on structural distinctions which are not of importance for our purposes.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Some people (<a href="http://www.jstor.org/stable/4178644">Baker 1989</a> and others), in fact, list this object sharing as a necessary part of the notion of a &#8220;serial verb construction.&#8221;&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:5">
<p>&#8220;Partial sentence&#8221; is used in a descriptive sense here to reflect that the relative clause, such as &#8220;I made&#8221; in the example given cannot stand as its own sentence, as the verb&#8217;s argument is clearly missing. This type of pattern is also seen in questions (&#8220;What did [you make]?&#8221;) and topicalization (&#8220;That sandwich, [I made].&#8221;) and is a great focus of theoretical linguistics research. See <a href="http://en.wikipedia.org/wiki/wh-movement">wh-movement</a> on wikipedia for more examples and information on theoretical approaches to such constructions.&#160;<a href="#fnref:5" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>We don&#8217;t do this right now as there hasn&#8217;t been a use for it—right now <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2">Parser 2</a> simply looks for known verbs at the beginning and end of the input. The parser does build a nice regular expression to find known verbs, however, so finding verbs input-medially would also be easy to do, though.&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:6">
<p>Note that even though the linguistic relation between the two commands is non-hierarchical, we interpret the sentences to mean &#8220;translate hello to Spanish and <em>then</em> email it to Juanito&#8221;, rather than &#8220;translate hello to Spanish and email it (hello) to Juanito <em>at the same time</em>.&#8221; This observed universal property that, ceteris paribus, the linear speech order of verbs reflects the conceptual order of events is known as the Temporal Iconicity Condition (<a href="http://www.jstor.org/pss/416696">Li 1993</a> and others).&#160;<a href="#fnref:6" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Permanent Link: Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Permanent Link: Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/link/ubiquity-in-italian/' rel='bookmark' title='Permanent Link: Ubiquity in Italian'>Ubiquity in Italian</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Ubiquity Persistence Project: exploring a persistent Ubiquity in the toolbar</title>
		<link>http://mitcho.com/blog/projects/the-ubiquity-persistence-project/</link>
		<comments>http://mitcho.com/blog/projects/the-ubiquity-persistence-project/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 19:50:13 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[participate]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2781</guid>
		<description><![CDATA[It&#8217;s often hard to remember Ubiquity&#8217;s presence and keystroke without a visual reminder—even I often forget that I could use Ubiquity and end up going to a search engine or using the search bar for some quick lookup task. What if the Ubiquity input were in the toolbar and always visible? How would that affect [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/' rel='bookmark' title='Permanent Link: User-Aided Disambiguation: a demo'>User-Aided Disambiguation: a demo</a></li>
<li><a href='http://mitcho.com/blog/projects/count-command-for-ubiquity/' rel='bookmark' title='Permanent Link: Count command for Ubiquity'>Count command for Ubiquity</a></li>
<li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Permanent Link: Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s often hard to remember Ubiquity&#8217;s presence and keystroke without a visual reminder—even I often forget that I could use Ubiquity and end up going to a search engine or using the search bar for some quick lookup task. <strong>What if the Ubiquity input were in the toolbar and always visible?</strong> How would that affect people&#8217;s use of Ubiquity? And what could we make that look like and how would it behave? Today we&#8217;re kicking off the Ubiquity Persistence Project, a new Ubiquity initiative to explore what a persistent Ubiquity might look like in the Firefox toolbar.</p>

<p><a rel='lightbox' href="http://mitcho.com/blog/wp-content/uploads/2009/08/Screen-shot-2009-08-20-at-12.48.43-PM.png" alt="The Persistence tool"><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/persistence-small.png" alt="persistence-small.png" border="0" width="650" height="484" /></a></p>

<p>In order to facilitate this discussion, we created the Persistence tool. With the Persistence tool you can quickly try out new design and interaction ideas, mocking things up with some simple <a href="http://jquery.com">jQuery</a>-powered JavaScript and CSS and see your changes live. The Persistence tool is bundled with our <a href="http://ubiquity.mozilla.com/xpi/ubiquity-latest-beta.xpi">latest Ubiquity beta</a> (install link).</p>

<p><object width="649" height="365"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6197526&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6197526&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="649" height="365"></embed></object></p>

<p><a href="http://vimeo.com/6197526">The Ubiquity Persistence Project: exploring a persistent Ubiquity in the toolbar</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>I just put together a screencast introducing the initiative, demoing the Persistence tool, as well as talking about this project&#8217;s relation to the ongoing work on <a href="http://wiki.mozilla.org/Taskfox">Taskfox</a>. We&#8217;ll look forward to your comments and designs! <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/' rel='bookmark' title='Permanent Link: User-Aided Disambiguation: a demo'>User-Aided Disambiguation: a demo</a></li>
<li><a href='http://mitcho.com/blog/projects/count-command-for-ubiquity/' rel='bookmark' title='Permanent Link: Count command for Ubiquity'>Count command for Ubiquity</a></li>
<li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Permanent Link: Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/the-ubiquity-persistence-project/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Exploring Command Chaining in Ubiquity: Part 1</title>
		<link>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/</link>
		<comments>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 20:35:37 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[verbs]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2760</guid>
		<description><![CDATA[Since the dawn of time people have been asking about command chaining in Ubiquity. If you have a translate command and an email command, it would be great to be able to, for example, translate hello to Spanish and email to Juanito. This is what we call command chaining or piping: in a single complex [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/' rel='bookmark' title='Permanent Link: Exploring Command Chaining in Ubiquity: Part 2'>Exploring Command Chaining in Ubiquity: Part 2</a></li>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Permanent Link: Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-commands-by-the-numbers/' rel='bookmark' title='Permanent Link: Ubiquity Commands by The Numbers'>Ubiquity Commands by The Numbers</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Since the <a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">dawn of time</a> people have been asking about command chaining in Ubiquity. If you have a <code>translate</code> command and an <code>email</code> command, it would be great to be able to, for example, <code>translate hello to Spanish and email to Juanito</code>. This is what we call <strong>command chaining</strong> or <strong><a href="http://en.wikipedia.org/wiki/Pipeline_(Unix)">piping</a></strong>: in a single complex query, specifying multiple (probably two) actions and using the first&#8217;s output as the second&#8217;s input.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>Today I hope to cover some of the technical considerations required in implementing command chaining in Ubiquity, and I will follow up soon with a blog post on the linguistic considerations required as well.</p>

<p><span id="more-2760"></span></p>

<h3>Technical considerations: hooking the pipes together</h3>

<p>I&#8217;d first like to lay out some technical challenges and questions. These can be broken into two different categories: (1) how the parse and display of suggestions is affected and (2) how the execution is affected.</p>

<h4>Matching inputs and outputs</h4>

<p>We&#8217;ll first consider how command chaining may affect the parsing. Ubiquity commands each specify the types of argument inputs that it expects using different <strong>noun types</strong>, such as <code>noun_arb_text</code> which accepts anything, <code>noun_type_number</code> which accepts numbers, or <code>noun_type_language</code>, which takes the name of a language. For example, the <code>translate</code> verb takes maximally three arguments: a <code>noun_arb_text</code> object, a <code>noun_type_language</code> goal (the language to translate into), and a <code>noun_type_language</code> source (the source language). In implementing command chaining, it will be necessary to identify the appropriate noun types for the <em>output</em> of a command.</p>

<p>The first question we must address here is <strong>&#8220;what is the chaining output of a command&#8221;?</strong> Is it the preview text? Some text output from the execution?</p>

<p><a href='http://www.flickr.com/photos/joemud/2851415655/'><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/2851415655_1012a4cce0_o.jpg" alt="2851415655_1012a4cce0_o.jpg" border="0" width="650" height="226" /></a><br/><small><a href='http://www.flickr.com/photos/joemud/2851415655/'>Big fish eat da lil fish</a> by joemud, CC-SA-NC</small></p>

<p>To put this question into perspective, we note that Ubiquity commands can be broadly classified into two types: <strong>lookup</strong> and <strong>action execution</strong>. Here&#8217;s a classification which I believe to be exhaustive:<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<table>
<tr><th>classification</th><th>preview</th><th>execution</th><th>example</th></tr>
<tr><td rowspan='4'>lookup</td><td rowspan='4'>data lookup</td><td>inserting result into page</td><td><code>translate</code></td></tr>
<tr><td>opening a website</td><td><code>weather</code>, most search commands</td></tr>
<tr><td>copying result to pasteboard</td><td><code>get email address</code></td></tr>
<tr><td>nothing</td><td><code></code></td></tr>
<tr><td>action</td><td>nothing (maybe a description<br/>of what the action will do)</td><td>an action which changes some state <br/>(in the browser or on the web)</td><td><code>quit firefox</code>, <code>email</code>, <code>twitter</code></td></tr>
</table>

<p>In light of this classification I believe we can say that lookup commands are much more likely to be the first verb in a command chain—conversely, chains such as <code>email hello to Blair and then do ...</code> or <code>twitter hello and then ...</code> are quite unlikely. What is much more likely is for the first verb to be a lookup function.</p>

<table>
<tr><th>first verb type</th><th>second verb type</th><th>example</th></tr>
<tr><td>lookup</td><td>action</td><td><code>translate this to Spanish and email to Aza</code></td>
<tr><td>lookup</td><td>lookup</td><td><code>translate this to English and then find it with Amazon</code></td>
<tr><td>action</td><td>action/lookup</td><td><i>no use case?</i></td>
</table>

<p>Thus in the same way that not all commands have a useful execution<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> <strong>perhaps only lookup commands will have a chainable output: the results of the lookup.</strong> Even with this restriction, we will most likely need to implement a new &#8220;chainable output&#8221; method or getter in these commands. This means that commands will need to opt-in to become chainable, but I believe this is a necessary evil.</p>

<p>The second question we must address is <strong>&#8220;when do we establish the noun type of a command&#8217;s chainable output?&#8221;</strong> One unsung but crucial feature of the way Ubiquity works now is that suggestions&#8217; previews are not computed until that suggestion is selected (except for the first suggestion, which in most skins gets previewed immediately). Should we wait for all of the first verbs&#8217; chainable output to be computed and then run them through the <a href="http://mitcho.com/blog/projects/judging-noun-types/">noun type detection system</a>? Or should verbs with chainable output also <em>a priori</em> specify what noun types their output will be?</p>

<p>Both of these approaches have their problems. If we compute the chainable output of the first verb, run a noun type detection on it and <em>then</em> suggest the full combination if it matches what the second verb was expecting, this will have clear performance implications, not to mention that it could greatly complicate our <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2">parsing algorithm</a>. While the latter approach doesn&#8217;t have these performance implications, it does mean that it will have to list (by name or reference) the noun types that will match its output, meaning that if a command author is unaware of someone else&#8217;s noun type, that chain will be impossible, even if the chainable output itself does indeed match that noun type. The <em>a posteriori</em> approach would never have this issue. <strong>What other benefits or problems do you forsee with either of these approaches? Is there another approach which avoids these pitfalls?</strong></p>

<h4>(A)synchronous composability</h4>

<p>Once we have the noun types, parsing, and suggestions down, all that remains is to compute the previews and implement the composite execution. Since the Ubiquity command manager already wraps the preview and execute functions in a wrapper to facilitate localization, among other uses, it would be easy to make the command manager <a href="http://www.croczilla.com/blog/16">compose asynchronous processes pseudo-synchronously</a>. No major changes should be necessary to do the previews and executions, though, again, there will be a performance cost.</p>

<h3>Conclusion</h3>

<p>There are a number of technical questions which must be answered, mostly in the parsing/suggesting stage. The key questions to answer are:</p>

<ol>
<li>What is the chaining output of a command?</li>
<li>When do we establish the noun type of a command&#8217;s chainable output?</li>
</ol>

<p>I&#8217;ll make another post soon on the linguistic considerations necessary in making command chaining happen in a <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural</a> fashion.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>We&#8217;re going to limit our discussion here to this restriction that the two verbs are not simply two simultaneous commands, but two commands which operate successively on an input, i.e., that it is true piping. This for example rules out input such as <code>google dogs and translate cat to Spanish</code>, as the second command&#8217;s execution does not semantically depend on the first&#8217;s execution. This (hopefully uncontroversial) decision also affects the linguistic considerations to be made in my next post.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>If you know of a command which doesn&#8217;t neatly fit into &#8220;lookup&#8221; or &#8220;action&#8221;, please let me know.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>I believe we should mark these no-execution lookup commands visually so the user does not expect anything to happen if they execute it. This is <a href="http://ubiquity.mozilla.com/trac/ticket/651">trac #651</a>.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/' rel='bookmark' title='Permanent Link: Exploring Command Chaining in Ubiquity: Part 2'>Exploring Command Chaining in Ubiquity: Part 2</a></li>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Permanent Link: Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-commands-by-the-numbers/' rel='bookmark' title='Permanent Link: Ubiquity Commands by The Numbers'>Ubiquity Commands by The Numbers</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Performance vs Responsiveness —or— How I Made the Parser Twice As Fast in One Day</title>
		<link>http://mitcho.com/blog/projects/performance-vs-responsiveness/</link>
		<comments>http://mitcho.com/blog/projects/performance-vs-responsiveness/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 06:16:54 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[response]]></category>
		<category><![CDATA[responsiveness]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2712</guid>
		<description><![CDATA[Since we launched Ubiquity 0.5, the issue of Parser 2 performance has been brought up over and over within the community. By virtue of having a more flexible and localizable design, Parser 2 was expected to be slower than our original parser, but its current implementation felt noticeably—perhaps unnecessarily—slow compared to Parser 1. Parser 2 [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Permanent Link: Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
<li><a href='http://mitcho.com/blog/projects/this-week-on-ubiquity-parser-the-next-generation/' rel='bookmark' title='Permanent Link: This week on Ubiquity Parser: The Next Generation'>This week on Ubiquity Parser: The Next Generation</a></li>
<li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Permanent Link: Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Since we <a href="http://labs.mozilla.com/2009/07/ubiquity-0-5/">launched Ubiquity 0.5</a>, the issue of Parser 2 performance has been brought up <a href="http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/b0dfa649dda77a2c#">over</a> and <a href="http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/13bc9ade35c8b708#">over</a> within the community. By virtue of having a <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2">more flexible and localizable design</a>, Parser 2 was expected to be slower than our original parser, but its current implementation felt noticeably—perhaps unnecessarily—slow compared to Parser 1. Parser 2 performance has been identified as <a href="https://wiki.mozilla.org/Labs/Ubiquity/Meetings/2009-08-05_Weekly_Meeting#Notes">one of the blockers</a> for pushing Ubiquity 0.5+ to all of our 0.1.x users, and has thus been one of my recent foci.</p>

<h3>The short story:</h3>

<p>Inspired by some comments by <a href="http://theunfocused.net">Blair</a>, yesterday I was able to make significant (roughly 100%) performance gains in Parser 2, resulting in 40-60% faster parses, depending on the query. This change <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/77156d689b26">has been committed</a> and will be released as part of our forthcoming minor update, Ubiquity 0.5.4. Yay!</p>

<p><span id="more-2712"></span></p>

<h3>The long story: asynchronous parsing</h3>

<p>Given that parsing in Ubiquity, combined with the post-parse of displaying suggestions, takes a good few dozen milliseconds, it is important to make sure it doesn&#8217;t block the main execution thread in order for the UI to stay responsive throughout. In other words, we needed to make it asynchronous.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>When we began work on Parser 2 a few months ago, <a href="http://theunfocused.net">Blair</a> stepped up to the plate to make it run asynchronously. For various reasons, the parser doesn&#8217;t run in a Worker thread for truer threading. Instead, what we did was to put the parser&#8217;s steps into a <a href="https://developer.mozilla.org/en/New_in_JavaScript_1.7#Generators_and_iterators">generator</a> called <code>_yieldingParse</code>. The keyword <code>yield</code> is scattered in points throughout this generator.</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> _yieldingParse<span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// step 1</span>
  ...
  <span style="color: #660066;">yield</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// step 2</span>
  ...
  <span style="color: #009900;">&#123;</span>
    ...
    <span style="color: #660066;">yield</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  ...
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>


<p>We then iterate over a <code>_yieldingParse</code> object in a function called <code>doAsyncParse</code>. Each time we go invoke <code>doAsyncParse</code>, it invokes <code>next</code> which advances from the last <code>yield</code> point of the parse to the next one. <code>doAsyncParse</code> checks after each step whether we should <code>keepworking</code> or not and then asynchronously advances to the next step by calling itself with a <code>setTimeout</code>. (Note the code below is a simplification.)</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> parseGenerator <span style="color: #339933;">=</span> _yieldingParse<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> doAsyncParse<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ok <span style="color: #339933;">=</span> parseGenerator.<span style="color: #660066;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ok <span style="color: #339933;">&amp;&amp;</span> keepworking<span style="color: #009900;">&#41;</span>
    Utils.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>doAsyncParse<span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// get this party started</span>
Utils.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>doAsyncParse<span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<p>The more often we <code>yield</code>, the more responsive the UI would be. However, there is a certain overhead to <code>yield</code>ing each time due to the <code>setTimeout</code>s we call. This point hit home when Blair told me the other day that the parser was much faster without any of the <code>setTimeout</code>s. Indeed, in my own testing running queries completely synchronously (replacing out all the <code>setTimeout</code>s), parses would run in roughly half the original time. However, by virtue of being completely synchronous, the parser would then completely lock up the UI.</p>

<p>I thus set out to strike a balance between performance and responsiveness by taking out and moving some of the <code>yield</code>s in our <code>_yieldingParse</code> (<a href="http://ubiquity.mozilla.com/trac/ticket/856">#856</a>).</p>

<h3>Tests, tests, tests</h3>

<p><a href='http://twitter.com/progrium/status/3273910705'><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/Screen-shot-2009-08-12-at-4.38.50-PM.png" alt="Screen shot 2009-08-12 at 4.38.50 PM.png" border="0" width="641" height="206" /></a></p>

<p>Keeping this in mind, I ran a number of tests as I proceeded with my &#8220;refactoring.&#8221;</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/notes1.jpg" alt="notes.jpg" border="0" width="649" height="327" /></p>

<p>Here are some final parse time results:<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/beforeafter1.png" alt="beforeafter.png" border="0" width="576" height="344" /></p>

<p>Four different queries (&#8220;hello to span&#8221;, &#8220;goo hello&#8221;, &#8220;22.7&#8221;, &#8220;tw as test&#8221; with a selection context of &#8220;hello world&#8221;) were run using each algorithm. The blue bar is the performance of the algorithm prior to adjustment of <code>setTimeout</code>s—that of Ubiquity 0.5.3. The gold bar is the time from a completely synchronous parse where all the <code>setTimeout</code>s were replaced. This algorithm completely locks up the UI, but is clearly the fastest, and should be seen as a baseline for all other yielding optimizations. The green bar is our new algorithm. As you can see, <strong>the parser is now roughly twice as fast.</strong></p>

<p>Moreover, the average time difference between <code>yield</code>s went from 0.7ms to 3.9ms which still should be no problem in terms of responsiveness.</p>

<h3>Cancellability</h3>

<p>This <code>doAsyncParse</code> is also the key for cancellability of the query. When a user changes the input or closes Ubiquity while a query is in progress, we want to cancel that query as soon as possible so the user and UI can advance. <code>keepworking</code> is set to false when the query is cancelled, so making sure that we <code>yield</code> early enough and often enough in the parse are important for issues like <a href="http://ubiquity.mozilla.com/trac/ticket/741">keystrokes being lost when typing too fast</a>.</p>

<p>While the parser was indeed <code>yield</code>ing often enough (in fact, more often than necessary) before, I noticed that our first <code>yield</code> was often 15-20&#160;ms into the parse. This was because step 1 of our parse derivation was happening outside of the <code>doAsyncParse</code> loop. By moving this into that loop, I was able to bring this initial synchronous time down to around 10&#160;ms. Of course, setting up the parse generator itself takes a little overhead, so this can never go down to 0, but perhaps this will improve <a href="http://ubiquity.mozilla.com/trac/ticket/741">the keystroke issue</a> as well. <strong>I&#8217;d love to get anecdotal feedback on whether this update improves the disappearing keystrokes issue from 0.5.4 users.</strong></p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>This is analogous to <a href="http://shawnwilsher.com/archives/279">a recent discussion of the asynchronous AwesomeBar</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>A note on methodology: the Parser 2 Playpen (<a href="chrome://ubiquity/content/playpen.html">chrome://ubiquity/content/playpen.html</a>) was used for all testing and timing. All tests were in Firefox 3.5 on Mac OS X Leopard. My machine is a 2.4&#160;GHz Intel Core 2 Duo MacBook Pro. No other (non-OS/daemon) apps were running. No other tabs were open and no other add-ons were installed.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Permanent Link: Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
<li><a href='http://mitcho.com/blog/projects/this-week-on-ubiquity-parser-the-next-generation/' rel='bookmark' title='Permanent Link: This week on Ubiquity Parser: The Next Generation'>This week on Ubiquity Parser: The Next Generation</a></li>
<li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Permanent Link: Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/performance-vs-responsiveness/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s talk about how cool our localizers are</title>
		<link>http://mitcho.com/blog/projects/lets-talk-about-how-cool-our-localizers-are/</link>
		<comments>http://mitcho.com/blog/projects/lets-talk-about-how-cool-our-localizers-are/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 20:17:53 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[BabelZilla]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2692</guid>
		<description><![CDATA[I uploaded Ubiquity to BabelZilla, an online community and tool for localizing Mozilla-style strings, just a couple days ago and we already have French and Polish complete.1 WOW! Granted, these are only Ubiquity&#8217;s interface strings (for example, the about and settings pages)&#8230; the parser localization and command localization have their own processes.2 But this is [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/' rel='bookmark' title='Permanent Link: A Visual Guide to Community Command Localization'>A Visual Guide to Community Command Localization</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Permanent Link: Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I uploaded <a href="http://ubiquity.mozilla.com">Ubiquity</a> to <a href="http://babelzilla.org">BabelZilla</a>, an online community and tool for localizing Mozilla-style strings, just a couple days ago and we already have French and Polish complete.<sup id="fnref:2"><a href="#fn:2" rel="footnote">1</a></sup> WOW!</p>

<p><a href="http://mitcho.com/blog/wp-content/uploads/2009/08/babelzilla-status.png" rel='lightbox'><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/babelzilla-status.png" alt="babelzilla-status.png" border="0" width="492" height="210" /></a></p>

<p>Granted, these are only Ubiquity&#8217;s interface strings (for example, the about and settings pages)&#8230; the <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2/Localization_Tutorial">parser localization</a> and <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Command_Localization_Tutorial">command localization</a> have their own processes.<sup id="fnref:1"><a href="#fn:1" rel="footnote">2</a></sup> But this is still a tremendous accomplishment!</p>

<p>Hopefully we can roll some of these complete or almost-complete interface localizations with <a href="http://tinyurl.com/ubiq054">Ubiquity 0.5.4</a> which is a minor bugfix update coming soon. <strong>If you would like to get involved with localizing the Ubiquity interface strings into your language, get a BabelZilla login and sign up on <a href="http://www.babelzilla.org/index.php?option=com_wts&amp;Itemid=264&amp;extension=5165&amp;type=show">the Ubiquity project page</a>.</strong> Thanks again to our rockin&#8217; localizers!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:2">
<p>I received notification that the Polish localization in particular has completed testing and is now ready for release, <em>as I was writing this blog post</em>.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:1">
<p>Perhaps this anecdote is telling us that having a nice centralized web interface for localizers to work together and without messing with the files directly is a plus. Perhaps we should put up the builtin commands for localization on something like <a href="http://en.wikipedia.org/wiki/Pootle">Pootle</a> or <a href="http://launchpad.net">Launchpad</a>. Thoughts, anyone?&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/' rel='bookmark' title='Permanent Link: A Visual Guide to Community Command Localization'>A Visual Guide to Community Command Localization</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Permanent Link: Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/lets-talk-about-how-cool-our-localizers-are/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nountype Quirks: Day 3: Geo Day</title>
		<link>http://mitcho.com/blog/projects/nountype-quirks-day-3/</link>
		<comments>http://mitcho.com/blog/projects/nountype-quirks-day-3/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 04:20:22 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[scoring]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2647</guid>
		<description><![CDATA[.scorebar { background-color:red; display:inline-block; height:0.5em; vertical-align:middle; } .scoretable td { font-size: 0.7em; } It&#8217;s time for one more installment of Nountype Quirks, where I review and tweak Ubiquity&#8217;s built-in nountypes. For an introduction to this effort, please read Judging Noun Types and my updates from Day 1 and Day 2. Today I ended up spending [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-2/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 2'>Nountype Quirks: Day 2</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Permanent Link: Judging Noun Types'>Judging Noun Types</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><style type='text/css'>
.scorebar {
  background-color:red;
  display:inline-block;
  height:0.5em;
  vertical-align:middle;
}
.scoretable td {
  font-size: 0.7em;
}
</style></p>

<p>It&#8217;s time for one more installment of Nountype Quirks, where I review and tweak <a href="http://ubiquity.mozilla.com">Ubiquity</a>&#8217;s built-in nountypes. For an introduction to this effort, please read <a href="http://mitcho.com/blog/projects/judging-noun-types/">Judging Noun Types</a> and my updates from <a href="http://mitcho.com/blog/projects/nountype-quirks-day-1/">Day 1</a> and <a href="http://mitcho.com/blog/projects/nountype-quirks-day-2/">Day 2</a>.</p>

<p>Today I ended up spending most of the day attempting to implement (but not yet completing) major improvements to the geolocation-related nountypes whose plans I lay out here.</p>

<p><em>Note: this blog post includes a number of graphs using HTML/CSS formatting. If you are reading this article through a feed reader or planet, I invite you to read it <a href="http://mitcho.com/blog/projects/nountype-quirks-day-3/">on my site</a>.</em><span id="more-2647"></span></p>

<h3><code>noun_type_geolocation</code></h3>

<p><code>noun_type_geolocation</code> is the nountype used by the <code>weather</code> command for its location argument in input like &#8220;weather near Chicago&#8221;. The neat feature of <code>noun_type_geolocation</code> is that it has a smart default value which uses Firefox&#8217;s geolocation system to give you your current location by default, so I can enter &#8220;weather&#8221; and get the suggestion &#8220;weather near Broomfield, Colorado&#8221; (not completely correct, but close enough for the weather). Otherwise, however, <code>noun_type_geolocation</code> does not do too hot&#8230; for any input you give it, it&#8217;ll just accept it with a score of 0.3, much like <code>noun_arb_text</code>. We could do better.</p>

<p>One issue with this <code>noun_type_geolocation</code> is a conceptual one. Is this nountype supposed to accept only municipalities? Countries? Or should it accept landmarks or addresses as well? Part of the issue is that it&#8217;s only used by one built-in command in Ubiquity now, <code>weather</code>. But to be called a general &#8220;geolocation&#8221; nountype, its output should not be specific to <code>weather</code>&#8217;s usage, which is to throw the result at the <a href="http://wunderground.com">Weather Underground</a> API.</p>

<p>I propose that we change this to be something like <code>noun_type_geo_town</code> and also make similar nountypes like <code>noun_type_geo_country</code>, <code>noun_type_geo_region</code>, going all the way down to <code>noun_type_address</code> (which already exists—see below). All of the nountypes in this family could use a geocoding API such as <a href="http://code.google.com/apis/maps/documentation/geocoding/index.html">Google&#8217;s</a> or <a href="http://developer.yahoo.com/maps/rest/V1/geocode.html">Yahoo&#8217;s</a>. Their <code>data</code> properties could include all of this geocoded geographic data (in English) and also the latitude/longitude coordinate data.</p>

<p>The <code>weather</code> command could then accept <code>noun_type_geo_town</code> but, as some municipalities are not in Weather Underground or, for some countries, it is only as granular as administrative districts, we could just display the results of the geocoding API but then give Weather Underground the geocoded latitude/longitude data.</p>

<h3><code>noun_type_async_address</code></h3>

<p><code>noun_type_async_address</code> attempts to do exactly what I&#8217;ve laid out above for the most granular level: that of geolocations with data all the way down to the street level. This is the nountype which is used for the built-in <code>map</code> command and uses the <a href="http://developer.yahoo.com/maps/rest/V1/geocode.html">Yahoo geocoding service</a> to accomplish this. Let&#8217;s see what kinds of results it returns:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>mitcho</td><td>mitcho</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td rowspan='1'>grenada</td><td>grenada</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>jono</td><td>jono</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>mountain view</td><td>mountain view</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
</table>

<p>Let&#8217;s lay out some immediate quirks:</p>

<ol>
<li>All scores are either 0.5 or 0.9. In general, if the Yahoo API returns some geocoded interpretation, it gets 0.9, but otherwise it accepts everything with 0.5.</li>
<li>The results that came back from the Yahoo service doesn&#8217;t add any useful information like the country or administrative region. Even the case stays lowercase.</li>
<li>Since when is Jono a location!? I&#8217;ll get back to this later.</li>
</ol>

<p>For starters, the Yahoo! Maps API terms of service dictate that we can&#8217;t use its geocoding service if we&#8217;re not also displaying Yahoo maps, so I rewrote it using the Google API which also had the advantage of offering JSON output.</p>

<p>One quirk of the Google Geocoding API, though, is that all of the resulting municipality names are only in English. Try for example queries for <a href="http://maps.google.com/maps/geo?q=Wien&amp;output=json&amp;oe=utf8&amp;sensor=false">Wien</a> or <a href="http://maps.google.com/maps/geo?q=%E6%9D%B1%E4%BA%AC&amp;output=json&amp;oe=utf8&amp;sensor=false">東京 (Tokyo)</a>. Since we want our suggestions to only add information to our input, not replace the input entirely (and especially not in another language), we&#8217;ll then only take results which have the input as an initial substring. On the other hand, if none of the results have the input as a proper prefix of the return value, we will take the geocoding information from the first result but with the original input as the display text. Such results will have a markedly lower score.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>As this is the <code>address</code> nountype, we&#8217;ll penalize results which do not have detailed information such as street address or town-level information. All of this is very easy to judge as every result from the API has a <a href="http://code.google.com/intl/ja/apis/maps/documentation/geocoding/index.html#GeocodingAccuracy">geocoding accuracy</a> value.</p>

<h3>The best laid plans of mice and men&#8230;</h3>

<p>I spent a good few hours this afternoon and evening <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/377daf3fe57a">attempting to implement</a> this new family of nountypes, including this new <code>nountype_geo_address</code>, but also <code>nountype_geo_subregion</code>, <code>nountype_geo_region</code>, and <code>nountype_geo_country</code>. Some of the quirks of the <code>weather</code> and <code>map</code> commands, however, have prevented me from completely replacing the legacy <code>noun_type_address</code> and <code>noun_type_geolocation</code> described above. I hope to continue this work again soon and actually make this transition, ideally before 0.5.2.</p>

<p>Look forward to one (or maybe two?) more episode(s) of Nountype Quirks where I hope to definitively explain, analyze, and tweak <code>matchScore</code>, the scoring algorithm which underlies the majority of the nountypes in Ubiquity. As always, I look forward to your comments and feedback.</p>

<h3>Bonus: Where&#8217;s Jono?</h3>

<p>It turns out that <code>noun_type_async_address</code> was recognizing &#8220;Jono&#8221; as an address because Jono is actually a location afterall! Not only that, but Jono is in Japan!!</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/Picture-31.png" alt="Picture 3.png" border="0" width="594" height="525" /></p>

<p>You clearly <a href="http://jonoscript.files.wordpress.com/2009/06/ubiquity_japanese.png">can&#8217;t take Japan out of Jono</a>, but it turns out you can&#8217;t take Jono out of Japan either.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>If this crazy algorithm raises a red flag for anyone, you&#8217;re not alone&#8230; if you think of a more elegant solution, please let me know. This will no doubt be an issue when it comes to localizing the <code>address</code> nountype as well. I wish we could specify an output language for the Google Geocoding API&#8230; <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> &#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-2/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 2'>Nountype Quirks: Day 2</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Permanent Link: Judging Noun Types'>Judging Noun Types</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/nountype-quirks-day-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nountype Quirks: Day 2</title>
		<link>http://mitcho.com/blog/projects/nountype-quirks-day-2/</link>
		<comments>http://mitcho.com/blog/projects/nountype-quirks-day-2/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 22:44:52 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[scoring]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2635</guid>
		<description><![CDATA[.scorebar { background-color:red; display:inline-block; height:0.5em; vertical-align:middle; } .scoretable td { font-size: 0.7em; } Today I&#8217;m continuing the process of reviewing and tweaking all of the nountypes built-in to Ubiquity. For a more respectable introduction to this endeavor, please read my blog post from a couple days ago, Judging Noun Types and my status update from [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-3/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 3: Geo Day'>Nountype Quirks: Day 3: Geo Day</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Permanent Link: Judging Noun Types'>Judging Noun Types</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><style type='text/css'>
.scorebar {
  background-color:red;
  display:inline-block;
  height:0.5em;
  vertical-align:middle;
}
.scoretable td {
  font-size: 0.7em;
}
</style></p>

<p>Today I&#8217;m continuing the process of reviewing and tweaking all of the nountypes built-in to <a href="http://ubiquity.mozilla.com">Ubiquity</a>. For a more respectable introduction to this endeavor, please read my blog post from a couple days ago, <a href="http://mitcho.com/blog/projects/judging-noun-types/">Judging Noun Types</a> and my status update from yesterday, <a href="http://mitcho.com/blog/projects/nountype-quirks-day-1/">Nountype Quirks: Day 1</a>.</p>

<p><em>Note: this blog post includes a number of graphs using HTML/CSS formatting. If you are reading this article through a feed reader or planet, I invite you to read it <a href="http://mitcho.com/blog/projects/nountype-quirks-day-2/">on my site</a>.</em></p>

<p><span id="more-2635"></span></p>

<h3><code>noun_type_twitter_user</code></h3>

<p>Let&#8217;s begin again by considering the suggestions and scores that a variety of different inputs to this nountype return and see what quirks we find.</p>

<p>To test this nountype, I made sure I had logged into <a href="http://twitter.com">Twitter</a> once with the login <a href="http://twitter.com/mitchoyoshitaka/"><code>mitchoyoshitaka</code></a>.</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='2'>mitcho</td><td>mitchoyoshitaka</td><td><span class='scorebar' style='width:425px'></span> 0.85</td></tr>
<tr><td>mitcho</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td rowspan='2'>mitchoyoshi</td><td>mitchoyoshitaka</td><td><span class='scorebar' style='width:470px'></span> 0.94</td></tr>
<tr><td>mitcho</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td>test</td><td>test</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td>テスト</td><td><i>none</i></td><td></td></tr>
<tr><td>hello world</td><td><i>none</i></td><td></td></tr>
<tr><td>@test</td><td><i>none</i></td><td></td></tr>
</table>

<p><a href="http://mitcho.com/blog/projects/nountype-quirks-day-1/">As nountypes go</a>, this is looking pretty good. For usernames which look like logins we&#8217;ve saved before, we&#8217;re using <code>matchScore</code> to get decent differential scores.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> It&#8217;s even ruling out impossible twitter username strings, according to Twitter&#8217;s own restriction:</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/twitter-usernames.png" alt="twitter-usernames.png" border="0" width="574" height="75" /></p>

<p>One possible improvement we could make is to let @ strings be accepted. I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/97871e3a453c">went ahead and made this improvement</a>. The initial @ will be stripped off and then will be checked as normal, but the final score will receive a slight boost using an <a href="http://en.wikipedia.org/wiki/nth_root"><i>n</i>th root</a> formula. The <code>twitter</code> command was also updated to deal with inputs with and without the initial @.</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='2'>mitcho</td><td>mitchoyoshitaka</td><td><span class='scorebar' style='width:425px'></span> 0.85</td></tr>
<tr><td>mitcho</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td rowspan='2'>@mitcho</td><td>@mitchoyoshitaka</td><td><span class='scorebar' style='width:440px'></span> 0.88</td></tr>
<tr><td>@mitcho</td><td><span class='scorebar' style='width:285px'></span> 0.57</td></tr>

<tr><td>test</td><td>test</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td>@test</td><td>@test</td><td><span class='scorebar' style='width:285px'></span> 0.57</td></tr>
</table>

<p>Although the <code>noun_type_twitter_user</code> nountype is currently most used by the built-in <code>twitter</code> command to specify the user&#8217;s username, in theory it could also be used for example in a command which pulls up another user&#8217;s tweets. With that in mind, perhaps in the future we could check the browser history and/or bookmarks for entries of the form <code>http://twitter.com/...</code> and suggest those as well (<a href="http://ubiquity.mozilla.com/trac/ticket/846">trac #846</a>).</p>

<h3><code>noun_type_number</code></h3>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>text</td><td><i>none</i></td><td></td></tr>
<tr><td>0.5</td><td>0.5</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>0.5.1</td><td><i>none</i></td><td></td></tr>
</table>

<p>This nountype has an incredibly simple job and does it with ease. I&#8217;m going to leave it alone.</p>

<h3><code>noun_type_date</code> and <code>noun_type_time</code></h3>

<p><code>noun_type_date</code> and <code>noun_type_time</code> both use the magical <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/parse">Date.parse</a> method to parse date- and time-like strings. Let&#8217;s first take a look at some of its suggestions:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th><code>date</code> suggestion</th><th><code>time</code> suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="250" height="15" /></th></tr>
<tr><td rowspan='1'>June 8th 5pm</td><td>2009-06-08</td><td>05:00 PM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>5pm</td><td>2009-07-30</td><td>05:00 PM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>5</td><td>2009-07-05</td><td>12:00 AM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>June 8th</td><td>2009-06-08</td><td>12:00 AM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>today</td><td>2009-07-30</td><td>12:00 AM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>now</td><td>2009-07-30</td><td>02:40 PM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>5pm is a good time</td><td><i>none</i></td><td><i>none</i></td><td></td></tr>
</table>

<p>The quirks in these outputs can be summed up into these two factors:</p>

<ol>
<li>There is no differential scoring at all.</li>
<li>Both nountypes parse the input with <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/parse">Date.parse</a> and then just spit out the date or time components of the result. Thus time-only inputs get the default date and date-only inputs get the default time with equal scores.</li>
</ol>

<p>I just rewrote both nountypes and also added a new <code>noun_type_date_time</code>. Here are some of the features of the new implementation:</p>

<ol>
<li>If the input only contains digits and spaces, it is marked down.</li>
<li>With the exception of the outputs &#8216;today&#8217; and &#8216;now&#8217;, if the resulting <code>Date</code> object&#8217;s date is today, its date suggestion is scored lower; equivalently for time being the default value, &#8220;12:00 AM&#8221;.</li>
<li>Scores (with the exception of &#8216;today&#8217; and &#8216;now&#8217;) which are shorter than the output string get a slight penalty. This factor reflects the intuition that a longer output than input means some generic information was added and thus there is less confidence in the output.</li>
</ol>

<p>Here&#8217;s what some of the inputs give now:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>

<tr><td rowspan='3'>June 8th 5pm</td><td><code>date</code>: 2009-06-08</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td><code>time</code>: 05:00 PM</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td><code>date_time</code>: 2009-06-08&#160;05:00 PM</td><td><span class='scorebar' style='width:430px'></span> 0.86</td></tr>

<tr><td rowspan='3'>5pm</td><td><code>date</code>: 2009-07-30</td><td><span class='scorebar' style='width:135px'></span> 0.27</td></tr>
<tr><td><code>time</code>: 05:00 PM</td><td><span class='scorebar' style='width:405px'></span> 0.81</td></tr>
<tr><td><code>date_time</code>: 2009-07-30&#160;05:00 PM</td><td><span class='scorebar' style='width:245px'></span> 0.49</td></tr>

<tr><td rowspan='3'>5</td><td><code>date</code>: 2009-07-05</td><td><span class='scorebar' style='width:265px'></span> 0.53</td></tr>
<tr><td><code>time</code>: 12:00 AM</td><td><span class='scorebar' style='width:95px'></span> 0.19</td></tr>
<tr><td><code>date_time</code>: 2009-07-05&#160;12:00 AM</td><td><span class='scorebar' style='width:170px'></span> 0.34</td></tr>

<tr><td rowspan='3'>June 8th</td><td><code>date</code>: 2009-06-08</td><td><span class='scorebar' style='width:475px'></span> 0.95</td></tr>
<tr><td><code>time</code>: 12:00 AM</td><td><span class='scorebar' style='width:175px'></span> 0.35</td></tr>
<tr><td><code>date_time</code>: 2009-06-08&#160;12:00 AM</td><td><span class='scorebar' style='width:170px'></span> 0.58</td></tr>

<tr><td rowspan='3'>today</td><td><code>date</code>: 2009-07-30</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td><code>time</code>: 12:00 AM</td><td><span class='scorebar' style='width:225px'></span> 0.45</td></tr>
<tr><td><code>date_time</code>: 2009-06-08&#160;12:00 AM</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>

<tr><td rowspan='3'>now</td><td><code>date</code>: 2009-07-30</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td><code>time</code>: 12:00 AM</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td><code>date_time</code>: 2009-06-08&#160;04:34 PM</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>

</table>

<p>In addition, looking to the future we&#8217;d <a href="http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/">like to make nountypes localizable</a> as well, and these two nountypes in particular will surely require some good thinking and planning to make localizable.</p>

<h3><code>noun_type_email</code> and <code>noun_type_contact</code></h3>

<p><code>noun_type_email</code> and <code>noun_type_contact</code> are two closely related nountypes. <code>noun_type_email</code> simply validates email address-looking strings, while <code>noun_type_contact</code> will return the <code>noun_type_email</code> suggestions and additionally return contacts from GMail if available.</p>

<p>The first thing to note is that I&#8217;ve often found the GMail contact lookup to be finicky in my own use. Reading through the code, I discovered the solution: GMail must either be open in a tab or you must use the &#8220;stay signed in&#8221; option and close the GMail tab.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> With this mystery solved, and <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/8478c7103753">some code cleanup done to this contact fetching</a>, let&#8217;s take a look at some example suggestions: (suggestions overlapping with <code>noun_type_email</code> are not listed here)</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>aza@m</td><td>aza@mozilla.com</td><td><span class='scorebar' style='width:210px'></span> 0.42</td></tr>
<tr><td rowspan='1'>jono</td><td>jdicarlo@mozilla.com</td><td><span class='scorebar' style='width:140px'></span> 0.28</td></tr>
<tr><td rowspan='1'>jdicarlo</td><td>jdicarlo@mozilla.com</td><td><span class='scorebar' style='width:95px'></span> 0.19</td></tr>
</table>

<p>In general, we see that these scores all look pretty poor. In particular, though, note that the &#8220;jono&#8221; input yielded a higher score for the same suggestion than &#8220;jdicarlo&#8221;, even though &#8220;jdicarlo&#8221; is longer and thus, intuitively, has more informational content and should maybe do better. Digging into the code I realized why this is. It was computing the scores by comparing &#8220;jono&#8221; and &#8220;jdicarlo&#8221; not simply to &#8220;Jono DiCarlo&#8221; and &#8220;jdicarlo@mozilla.com&#8221; respectively, but to the combined string &#8220;Jono DiCarlo &lt;jdicarlo@mozilla.com&gt;&#8221;. Now with <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/0877848192f2">this change</a> in place, both the email address and name are analyzed individually and, due to the way nountype detection works in Parser 2, no duplicates are returned. Here are the updated results:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>jono</td><td>jdicarlo@mozilla.com</td><td><span class='scorebar' style='width:415px'></span> 0.83</td></tr>
<tr><td rowspan='1'>jdicarlo</td><td>jdicarlo@mozilla.com</td><td><span class='scorebar' style='width:425px'></span> 0.85</td></tr>
</table>

<p>That&#8217;s much better!</p>

<p>Now let&#8217;s consider the suggestions from <code>noun_type_email</code>. Here are what they originally looked like:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>bpung</td><td><i>none</i></td><td></td></tr>
<tr><td rowspan='1'>bpung@m</td><td>bpung@m</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td rowspan='1'>bpung@mozilla.com</td><td>bpung@mozilla.com</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
</table>

<p><code>noun_type_email</code> is based on <a href="http://blog.livedoor.jp/dankogai/archives/51190099.html">a very robust regular expression</a> for <a href="http://www.ietf.org/rfc/rfc2822.txt">RFC 2822</a>. Unfortunately this means that it completely rules out strings such as &#8220;bpung&#8221; which could be a proper prefix of an email address—something that I&#8217;ve advocated for avoiding before (see footnote 2 of <a href="http://mitcho.com/blog/projects/judging-noun-types/">Judging Noun Types</a>). Moreover, due to a quirk of how nountypes based on regular expressions are scored, all results are given the score of 1.</p>

<p>I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/0d1803104c7d">just committed a change</a> so that this behavior is improved. The new version accepts strings which match the username part of the email address spec sans @ and domain, but with a great score penalty.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> Moreover, domains which do not have a final label (the <a href="http://en.wikipedia.org/wiki/top level domain">top level domain</a>) with more than one letter (unless it&#8217;s an IP address) or do not have any periods (.) in the domain will be penalized as well. Here&#8217;s what the same inputs produce now:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>bpung</td><td>bpung</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='1'>bpung@m</td><td>bpung@m</td><td><span class='scorebar' style='width:400px'></span> 0.8</td></tr>
<tr><td rowspan='1'>bpung@mozilla.com</td><td>bpung@mozilla.com</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
</table>

<h3>Same time, same channel</h3>

<p>I hope this post sheds light on the many changes I made together as well as the underlying thought process. If you don&#8217;t agree with any particular fix or analysis, please comment! I&#8217;ll be back again tomorrow with another installment of Nountype Quirks. Stay tuned!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Again, <code>matchScore</code> will be the subject of another blog post in the near future.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Moreover, due to the way <code>noun_type_contact</code> caches the contact list internally, as long as GMail&#8217;s contacts are available once, you should be able to continue accessing those contacts&#8217; suggestions after logging out of GMail. There are also great performance benefits to this caching. The downside is that we currently have no way to know when to clear the cache, so even if you update your contacts in GMail, those new contacts won&#8217;t appear in Ubiquity until you restart Firefox.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>Perhaps this is a horrible idea, because if executed or previewed, any verb which uses these nountypes would have to deal with arguments which are not valid email addresses. In my mind, though, as long as it doesn&#8217;t actually cause any error, this should be okay. Keep in mind that, given the very low scores given to these suggestions, parses using it would most likely only show up if the verb which requires these nountypes was explicitly given and there are other arguments as well, for example in input like &#8220;email hello to bpung&#8221;. In such a situation, we would rather this suggestion not disappear until we type &#8220;@m&#8221;. If executed, the built-in email verb, for instance, will deal with this gracefully by simply putting the incomplete email address in the To field.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-3/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 3: Geo Day'>Nountype Quirks: Day 3: Geo Day</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Permanent Link: Judging Noun Types'>Judging Noun Types</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/nountype-quirks-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nountype Quirks: Day 1</title>
		<link>http://mitcho.com/blog/projects/nountype-quirks-day-1/</link>
		<comments>http://mitcho.com/blog/projects/nountype-quirks-day-1/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 23:00:56 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[scoring]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2598</guid>
		<description><![CDATA[.scorebar { background-color:red; display:inline-block; height:0.5em; vertical-align:middle; } .scoretable td { font-size: 0.7em; } Today I began the process of going through all of the nountypes built-in to Ubiquity using the principles and criteria I laid out yesterday—a task I&#8217;ve had in planning for a while now. As I explained yesterday, improved suggestions and scoring from [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-3/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 3: Geo Day'>Nountype Quirks: Day 3: Geo Day</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-2/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 2'>Nountype Quirks: Day 2</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><style type='text/css'>
.scorebar {
  background-color:red;
  display:inline-block;
  height:0.5em;
  vertical-align:middle;
}
.scoretable td {
  font-size: 0.7em;
}
</style></p>

<p>Today I began the process of going through all of the nountypes built-in to <a href="http://ubiquity.mozilla.com">Ubiquity</a> using <a href="http://mitcho.com/blog/projects/judging-noun-types/">the principles and criteria I laid out yesterday</a>—a task I&#8217;ve had <a href="http://ubiquity.mozilla.com/trac/ticket/746">in planning</a> for a while now. As I explained yesterday, improved suggestions and scoring from the built-in nountypes could directly translate to better and smarter suggestions, resulting in a better experience for all users. Here I&#8217;ll document some of the nountype quirks I&#8217;ve discovered so far and what remedy has been implemented or is planned.</p>

<p><em>Note: this blog post includes a number of graphs using HTML/CSS formatting. If you are reading this article through a feed reader or planet, I invite you to read it <a href="http://mitcho.com/blog/projects/nountype-quirks-day-1/">on my site</a>.</em></p>

<p><span id="more-2598"></span></p>

<h3><code>noun_type_percentage</code></h3>

<p>Here&#8217;s what a few different inputs originally returned:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td>20</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>20%</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>0.2</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>0.2%</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>20.0</td><td>2000%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>2 hens in the garden</td><td>2%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
</table>

<p>Let me highlight a couple obvious quirks:</p>

<ol>
<li>In certain cases, where the numerical expression includes a decimal and is less than one, it is interpreted as a proportional, rather than percent, value, e.g. &#8220;0.2&#8221; → &#8220;20%&#8221;. &#8220;0.2%&#8221; is not even an option. This is the case even when explicitly adding a % sign.</li>
<li>All suggestions, including those where the numeral was extracted from a long string of text (e.g. &#8220;2 hens in the garden&#8221;), get the same score of 1.</li>
</ol>

<p>I just <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/c3cd4af0f06a">committed a fix</a> so <code>noun_type_percentage</code> now&#8230;</p>

<ol>
<li>Counts the number of characters in the input which match <code>[\d.%]</code> and caps the score by (number of acceptable characters)/(length of input).</li>
<li>Strings which do not include &#8220;%&#8221; get a 10% penalty.</li>
<li>In the case of decimals less than 1 without a % sign, the proportion interpretation is also suggested (e.g. &#8220;0.2&#8221; → &#8220;20%&#8221;) in addition to the original suggestion (&#8220;0.2%&#8221;), but with a slight penalty.</li>
</ol>

<p>Here is what they now return:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td>20</td><td>20%</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>20%</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td rowspan='2'>0.2</td><td>0.2%</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>20%</td><td><span class='scorebar' style='width:405px'></span> 0.81</td></tr>
<tr><td>0.2%</td><td>0.2%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>20.0</td><td>20%</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>2 hens in the garden</td><td>2%</td><td><span class='scorebar' style='width:25px'></span> 0.05</td></tr>
</table>

<h3><code>noun_type_tag</code></h3>

<p>Here&#8217;s what a few different inputs originally returned. Keep in mind that currently in this test profile, the preexisting tags are &#8220;animal&#8221;, &#8220;help&#8221;, &#8220;test&#8221;, and &#8220;ubiquity&#8221;.</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td>animal</td><td>animal</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td>mineral</td><td>mineral</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>anim</td><td>animal</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td>anim</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>help, test, ubiq</td><td>help,test,ubiquity</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td>help,test,ubiq</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>google, yahoo, ubiq</td><td>google,yahoo,ubiquity</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td>google,yahoo,ubiq</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td>google, , yahoo</td><td>google,yahoo</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
</table>

<p>Here are a few of <code>noun_type_tag</code>&#8217;s quirks:</p>

<ol>
<li>There are only two scores ever given out: 0.3 and 0.7.</li>
<li>Only the last tag in the list and whether it exists or not is taken into account.</li>
<li>When the last tag is incomplete, the completion is suggested with a higher score, but if the last tag is <em>exactly</em> equal to an existing tag, it gets the lower score.</li>
</ol>

<p>Ideally, we want <code>noun_type_tag</code> to look at each of the tags given to it, with higher scores for when there are more preexisting tags and fewer new ones. Keep in mind, though, that we only have to suggest the completion of the very last tag as that may be one where the user hasn&#8217;t completed typing yet&#8230; for earlier tags, we can assume (safely or not) that the user placed the comma where they meant to. We can&#8217;t teach Ubiquity to read minds, after all.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>With this in mind, I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/54e6a232ec3a">just made a change</a> to <code>noun_type_tag</code> which aims to follow these principles. The basic idea is that we start with a base score of 0.3 but then raise it via <a href="http://en.wikipedia.org/wiki/nth root"><i>n</i>th root</a> for every tag in the sequence which is preexisting. Here&#8217;s what the same inputs return now. Recall that the preexisting tags are &#8220;animal&#8221;, &#8220;help&#8221;, &#8220;test&#8221;, and &#8220;ubiquity&#8221;.</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td>animal</td><td>animal</td><td><span class='scorebar' style='width:275px'></span> 0.55</td></tr>
<tr><td>mineral</td><td>mineral</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>anim</td><td>animal</td><td><span class='scorebar' style='width:275px'></span> 0.55</td></tr>
<tr><td>anim</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>help, test, ubiq</td><td>help,test,ubiquity</td><td><span class='scorebar' style='width:430px'></span> 0.86</td></tr>
<tr><td>help,test,ubiq</td><td><span class='scorebar' style='width:370px'></span> 0.74</td></tr>
<tr><td rowspan='2'>google, yahoo, ubiq</td><td>google,yahoo,ubiquity</td><td><span class='scorebar' style='width:275px'></span> 0.55</td></tr>
<tr><td>google,yahoo,ubiq</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td>google, , yahoo</td><td>google,yahoo</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
</table>

<h3><code>noun_type_awesomebar</code></h3>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='4'>moz</td><td class="sugg">http://www.mozilla.com/</td><td class="score"><span style="width: 400px;" class="scorebar">&nbsp;</span> 0.8</td></tr>
<tr><td class="sugg">https://wiki.mozilla.org/Labs/Ubiquity/ Parser_2_API_Conversion_Tutorial</td><td class="score"><span style="width: 400px;" class="scorebar">&nbsp;</span> 0.8</td></tr>
<tr><td class="sugg">http://en-us.start3.mozilla.com/ firefox?client=firefox-a&#038;rls= org.mozilla:en-US:official</td><td class="score"><span style="width: 400px;" class="scorebar">&nbsp;</span> 0.8</td></tr>
<tr><td class="sugg">http://en-us.www.mozilla.com/en-US/firefox/about/</td><td class="score"><span style="width: 400px;" class="scorebar">&nbsp;</span> 0.8</td></tr>
</table>

<p>There are a couple quirks here:</p>

<ol>
<li>All suggestions are returned with the same scores.</li>
<li>The nountype returns the URL of the entry as the HTML-formatted result and the title as the text-formatted result, which clearly does not make sense. However, it&#8217;s not clear to me whether the title, URL, or some combination of both is what we should be returning as the suggestion text presented to the user.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></li>
</ol>

<p>I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/cb98c72364db">just rewrote <code>noun_type_awesomebar</code></a> to actually do some differential scoring. This new version also presents the URL or title depending on whichever had a better match using the <code>matchScore</code> function.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup></p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='4'>moz</td><td class="sugg">www.mozilla.com</td><td class="score"><span style="width: 350px;" class="scorebar">&nbsp;</span> 0.7</td></tr>
<tr><td class="sugg">https://wiki.mozilla.org/Labs/Ubiquity/ Parser_2_API_Conversion_Tutorial</td><td class="score"><span style="width: 315px;" class="scorebar">&nbsp;</span> 0.63</td></tr>
<tr><td class="sugg">http://en-us.start3.mozilla.com/ firefox?client=firefox-a&#038;rls= org.mozilla:en-US:official</td><td class="score"><span style="width: 305px;" class="scorebar">&nbsp;</span> 0.61</td></tr>
<tr><td class="sugg">http://en-us.www.mozilla.com/en-US/firefox/about/</td><td class="score"><span style="width: 300px;" class="scorebar">&nbsp;</span> 0.6</td></tr>
</table>

<h3><code>noun_type_url</code></h3>

<p>The purpose of <code>noun_type_url</code>&#8217;s suggest function is two-fold: first, to accept strings which may look like a URL and, second, to suggest URL&#8217;s from the history just like <code>noun_type_url</code>, but only based on URL matches and not title matches.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> Here are a few sample inputs:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='5'>moz</td><td class="sugg">http://www.mozilla.com/</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>
<tr><td class="sugg">http://moz</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td class="sugg">https://wiki.mozilla.org/Labs/Ubiquity/ Parser_2_API_Conversion_Tutorial</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>
<tr><td class="sugg">http://en-us.start3.mozilla.com/ firefox?client=firefox-a&#038;rls= org.mozilla:en-US:official</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>
<tr><td class="sugg">http://en-us.www.mozilla.com/en-US/firefox/about/</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>

<tr><td rowspan='1'>test</td><td class="sugg">http://test</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>http://</td><td class="sugg">http://</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>http:</td><td class="sugg">http:</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>http</td><td class="sugg">http</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>_test</td><td class="sugg">http://_test</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>hello world!</td><td class="sugg">http://hello world!</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
</table>

<p>Oh, where to begin!? Here are some initial quirks&#8230; it&#8217;s possible that you could think of more!</p>

<ol>
<li>There is no differential scoring&#8230; only 0.9 for suggestions from history and 0.5 for URL-like strings.</li>
<li>A number of invalid domain names are being accepted and turned into suggestions (&#8220;hello world!&#8221;, &#8220;_test&#8221;, etc.).</li>
<li>It&#8217;s trying to be smart by suggesting &#8220;http://&#8221; as a default <a href="http://en.wikipedia.org/wiki/URI scheme">URI scheme</a> but doing so even for prefixes (initial substrings) of the word &#8220;http&#8221; itself.</li>
</ol>

<p>With these thoughts in mind, I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/26f179661107">just took a first stab</a> at improving this situation. Here are some features of the new implementation:</p>

<ol>
<li>History entries are scored in the same way as in <code>noun_type_awesomebar</code>, using <code>matchScore</code>.</li>
<li>URLs without an explicit <a href="http://en.wikipedia.org/wiki/URI scheme">URI scheme</a> (like &#8220;http://&#8221;) get a 10% penalty.</li>
<li>&#8220;http://&#8221; is only suggested if one of a long list of common URI schemes are not detected.</li>
<li>It repairs schemes which are missing a slash or two, suggesting for example &#8220;http:hello.com&#8221; → &#8220;http://hello.com&#8221;.</li>
<li>It actually uses Firefox&#8217;s own <a href="https://developer.mozilla.org/en/nsIIDNService">IDNService</a> to check if the domain name is a valid <a href="http://en.wikipedia.org/wiki/internationalized domain name">internationalized domain name</a>. If it&#8217;s an IDN as opposed to LDH (&#8220;letters, digits, and hyphens&#8221;), it gets a 10% penalty. If it&#8217;s not even a valid IDN, it is ruled out (see last two example inputs below).</li>
<li>There are also penalties for only being a domain name with no path and for the domain not having any periods (.) in it.</li>
</ol>

<p>Here is what our suggestions now look like:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='5'>moz</td><td class="sugg">http://www.mozilla.com/</td><td class="score"><span style="width: 300px;" class="scorebar">&nbsp;</span> 0.6</td></tr>
<tr><td class="sugg">http://moz</td><td class="score"><span style="width: 325px;" class="scorebar">&nbsp;</span> 0.65</td></tr>
<tr><td class="sugg">https://wiki.mozilla.org/Labs/Ubiquity/ Parser_2_API_Conversion_Tutorial</td><td class="score"><span style="width: 315px;" class="scorebar">&nbsp;</span> 0.63</td></tr>
<tr><td class="sugg">http://en-us.start3.mozilla.com/ firefox?client=firefox-a&#038;rls= org.mozilla:en-US:official</td><td class="score"><span style="width: 305px;" class="scorebar">&nbsp;</span> 0.61</td></tr>
<tr><td class="sugg">http://en-us.www.mozilla.com/en-US/firefox/about/</td><td class="score"><span style="width: 300px;" class="scorebar">&nbsp;</span> 0.6</td></tr>

<tr><td rowspan='1'>test</td><td class="sugg">http://test</td><td class="score"><span style="width: 325px;" class="scorebar">&nbsp;</span> 0.65</td></tr>
<tr><td rowspan='2'>http://</td><td class="sugg">http://</td><td class="score"><span style="width: 500px;" class="scorebar">&nbsp;</span> 1</td></tr>
<tr><td class="sugg">shttp://</td><td class="score"><span style="width: 375px;" class="scorebar">&nbsp;</span> 0.75</td></tr>

<tr><td rowspan='2'>http:</td><td class="sugg">http://</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>
<tr><td class="sugg">shttp://</td><td class="score"><span style="width: 350px;" class="scorebar">&nbsp;</span> 0.7</td></tr>

<tr><td rowspan='4'>http</td><td class="sugg">http://</td><td class="score"><span style="width: 360px;" class="scorebar">&nbsp;</span> 0.72</td></tr>
<tr><td class="sugg">https://</td><td class="score"><span style="width: 355px;" class="scorebar">&nbsp;</span> 0.71</td></tr>
<tr><td class="sugg">shttp://</td><td class="score"><span style="width: 340px;" class="scorebar">&nbsp;</span> 0.68</td></tr>
<tr><td class="sugg">http://http</td><td class="score"><span style="width: 325px;" class="scorebar">&nbsp;</span> 0.65</td></tr>

<tr><td rowspan='1'>_test</td><td class="sugg"><i>none</i></td><td class="score">&nbsp;</td></tr>
<tr><td rowspan='1'>hello world!</td><td class="sugg"><i>none</i></td><td class="score">&nbsp;</td></tr></table>

<h3>See you tomorrow~</h3>

<p>Alright, enough nountype wrangling for one day. I&#8217;ll be back again tomorrow for another installment.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>If we could make assumptions about what tags look like, for example that they are always pretty short, or use certain character classes, we could use such factors as well to judge non-preexisting tags for &#8220;tagginess&#8221; but unfortunately it&#8217;s possible (though unlikely) that a user would prefer really long tag strings and of course Firefox allows tags in any unicode code range. The only strings we can immediately rule out as impossible are ones which are purely whitespace.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>It&#8217;s actually unclear whether the method we&#8217;re using (<a href="https://developer.mozilla.org/en/nsIAutoCompleteSearch"><code>nsIAutoCompleteSearch</code></a>) is actually searching titles or not&#8230; it currently looks like it&#8217;s only looking at the URL&#8217;s. Perhaps the title query is what we&#8217;re supposed to enter in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=507315">the mystery parameter</a>.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>I hope to discuss the <code>matchScore</code> function in a separate blog post later.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>While writing up this section I ran into a bug whereby when both <code>noun_type_awesomebar</code> and <code>noun_type_url</code> are active, only one of their async callbacks from <code>Utils.history.search</code> are returned. Thus, if lucky, only one of the nountypes will return the history results and if unlucky the parse query will not complete. Filed as <a href="http://ubiquity.mozilla.com/trac/ticket/845">trac #845</a>.&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-3/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 3: Geo Day'>Nountype Quirks: Day 3: Geo Day</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-2/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 2'>Nountype Quirks: Day 2</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/nountype-quirks-day-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Judging Noun Types</title>
		<link>http://mitcho.com/blog/projects/judging-noun-types/</link>
		<comments>http://mitcho.com/blog/projects/judging-noun-types/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 06:39:11 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[scoring]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2588</guid>
		<description><![CDATA[Introduction Different arguments are classified into different kinds of nouns in Ubiquity using noun types.1 For example, a string like &#8220;Spanish&#8221; could be construed as a language, while &#8220;14.3&#8221; should not be. These kinds of relations are then used by the parser to introduce, for example, language-related verbs (like translate) using the former argument, and [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-2/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 2'>Nountype Quirks: Day 2</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-3/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 3: Geo Day'>Nountype Quirks: Day 3: Geo Day</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>

<p>Different arguments are classified into different kinds of nouns in Ubiquity using <em>noun types</em>.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> For example, a string like &#8220;Spanish&#8221; could be construed as a language, while &#8220;14.3&#8221; should not be. These kinds of relations are then used by the parser to introduce, for example, language-related verbs (like <code>translate</code>) using the former argument, and number-related verbs (like <code>zoom</code> or <code>calculate</code>) based on the latter. Ubiquity nountypes aren&#8217;t exclusive—a single string can count as valid for a number of different nountypes and in particular the &#8220;arbitrary text&#8221; nountype (<code>noun_arb_text</code>) will always accept any string given.</p>

<p>In addition to the <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/raw-file/tip/ubiquity/modules/nountypes.js">various built-in nountypes</a>, Ubiquity lets command authors <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_Source_Tip_Author_Tutorial#Writing_a_Noun_Type_Object">write their own nountypes</a> as well.</p>

<h3>The functions of a noun type</h3>

<p>Nountypes have two functions: the first is <strong>accepting and suggesting</strong> suggestions and the second is <strong>scoring</strong>.</p>

<p><span id="more-2588"></span></p>

<h4>Accepting and suggesting</h4>

<p>Nountypes don&#8217;t just have to accept the exact string they were given—they can also return suggestions which are based on that input. For example, the <code>noun_type_language</code> can take the input &#8220;span&#8221; and return &#8220;Spanish.&#8221; A nountype can return multiple suggestions which may or may not include the trivial suggestion, i.e. the original input as is. If there is no way that that input could possibly be part of an accepted value, it should return no suggestions, i.e. <code>[]</code>.<sup id="fnref:3"><a href="#fn:3" rel="footnote">2</a></sup></p>

<h4>Scoring</h4>

<p>Ubiquity 0.5 with Parser 2 introduced the notion of a nountype suggestion <em>score</em>. For example, two different nountypes can accept the same input, but with different scores. Scores range from 0 to 1 where 1 is a perfect or exact suggestion and 0.1 or so is a very very improbable suggestion.<sup id="fnref:2"><a href="#fn:2" rel="footnote">3</a></sup> These scores are used in the <a href="http://mitcho.com/blog/observation/scoring-for-optimization/">scoring of parses</a>. Because verbs specify certain nountypes for each of their arguments, the scores that individual nountypes return for each argument are a crucial component of the scoring algorithm and can even determine whether a parse is returned or not.</p>

<p>With this in mind, you may be tempted to make your nountype return a score of 1 on any input so your verb will show up in the suggestions highly. While this would work, it will only act to make your verb annoying and a poor Ubiquity citizen. Appropriate scores must be given to noun suggestions, with higher values reflecting confidence and lower values reflecting imprecision. <em>But how exactly do you figure out what&#8217;s an appropriate value?</em></p>

<h3>Judging nountypes with the Nountype Tuner</h3>

<p>The Nountype Tuner is a new tool I&#8217;ve been building to help both Ubiquity core developers and command authors to check their nountypes against others and to &#8220;tune&#8221; their behavior and scores. The nountype tuner will take your input and throw it against all of the nountypes referenced in your active verbs and display the suggestions returned with their scores. You can think of it as <a href="http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/">the Playpen</a>&#8217;s little sister.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner.png" alt="tuner.png" border="0" width="650" height="646" /></p>

<p>The Nountype Tuner can be found at <a href='chrome://ubiquity/content/tuner.html'>chrome://ubiquity/content/tuner.html</a>, though I am pretty sure it is broken in Ubiquity 0.5 and 0.5.1. It has been fixed now and I will make sure it&#8217;s in good shape for 0.5.2.</p>

<p>The heart and soul of the Nountype Tuner is this scale:</p>

<p><center><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></center></p>

<p>This scale tells you, <em>in plain English</em>, what different scores represent and correspond to, in two sets of vocabulary: &#8220;in terms of a guess&#8221; and &#8220;in terms of a match.&#8221; While still subjective, this scale helps developers just different input/output pairs and their scores. For example, &#8220;lian&#8221; → &#8220;http://lian&#8221; is given 0.5, so it&#8217;s an okay guess or a possible match&#8230; does that seem right to you? Or &#8220;lian&#8221; → &#8220;Italian&#8221; being between &#8220;okay&#8221; and &#8220;good.&#8221; Appropriate? We can look at such statements, decide how we feel about them, and tweak if necessary.</p>

<h3>Good nountype scores have roots</h3>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/roots.jpg" alt="roots.jpg" border="0" width="650" height="300" /></p>

<p><small>CC-BY <a href="http://www.flickr.com/photos/aaronescobar/2569091622/">Aaron Escobar</a></small></p>

<p>&#8230;not that kind of root, but more like <a href="http://en.wikipedia.org/wiki/Nth_root">this kind of root</a>&#8230; let me explain&#8230;</p>

<p>When comparing the scores that individual nountypes return for different inputs, we must compare those scores <em>within the same nountype&#8217;s family of suggestions</em> to see if higher scores truly correspond to higher confidence. For example, the language nountype should give the suggestion &#8220;French&#8221; for both the inputs &#8220;f&#8221; and &#8220;fren,&#8221; but the scores of these suggestions should be different—i.e. the score of &#8220;f&#8221; → &#8220;French&#8221; should be much lower than the score for &#8220;fren&#8221; → &#8220;French,&#8221; reflecting the additional informational value. We refer to this relation of the scores of successive prefixes of a single suggestion all returning that same suggestion as the <em>score curve</em> and in general it should be non-decreasing.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup></p>

<p>One could say the most trivial score function then is the linear one. For a series of converging prefixes of the same suggestion (&#8220;Dutch&#8221;), under a linear approach we could naively let the score be (length of the input)/(length of the suggestion), as below:</p>

<p><center></p>

<h4>the linear model</h4>

<table>
<tr><th>input</th><td>d</td><td>du</td><td>dut</td><td>dutc</td><td>dutch</td></tr>
<tr><th>output</th><td>Dutch</td><td>Dutch</td><td>Dutch</td><td>Dutch</td><td>Dutch</td></tr>
<tr><th>score</th><td>0.2</td><td>0.4</td><td>0.6</td><td>0.8</td><td>1</td></tr>
</table>

<p></center></p>

<p>This linear model is represented below by the black line.</p>

<p><center><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/nth-roots.png" alt="nth-roots.png" border="0" width="299" height="262" /></center></p>

<p>The problem with the linear model is that earlier transitions (additional keystrokes) <em>add more information</em> than the later ones. Once we&#8217;ve entered &#8220;dutc,&#8221; after all, we would like to be <em>pretty darn sure</em> that we mean &#8220;Dutch,&#8221; so the score difference between &#8220;dutc&#8221; and &#8220;dutch&#8221; should be less than the score difference between, say, &#8220;d&#8221; and &#8220;du.&#8221; We want a score curve that looks more like the solid or dotted red lines above.</p>

<p>For this reason, <strong>I strongly advocate the incorporation of an <em>n</em>th-root in the score computation</strong>. <em>N</em>th-rooted score functions over [0,1] have the feature that they are increasing but also that earlier transitions affect the score more than later ones, which is exactly what we&#8217;d like to see. (The solid red line above is <code>x^1/2</code> and the dotted one is <code>x^1/3</code>.)<sup id="fnref:5"><a href="#fn:5" rel="footnote">5</a></sup></p>

<h3>Conclusion</h3>

<p>Properly tuning both the built-in nountypes and custom nountypes is crucial to producing more accurate and relevant parse suggestions. I&#8217;ll be using the principles and criteria laid out above, combined with the new Nountype Tuner, to <a href="http://ubiquity.mozilla.com/trac/ticket/746">tune the built-in nountypes (trac #746)</a> in the coming days in preparation for our <a href="http://tinyurl.com/lgekyh">0.5.2 release</a>. I invite you to use the Nountype Tuner in 0.5.2 to tune your custom nountypes as well.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Or, as I often write them, &#8220;nountypes.&#8221;&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>Note that I didn&#8217;t just say &#8220;if the input is not an accepted value&#8230;&#8221; That&#8217;s because, based on the left-to-right nature of text input, an argument may later become a valid input of a certain nountype with a few more keystrokes. For example, if we had a URL nountype which accepted &#8220;http://mitcho.com&#8221; but not &#8220;http://mitcho&#8221;, any command which took this nountype would not show up in the suggestions while we were typing out &#8220;http://mitcho&#8221;&#8230; but would suddenly appear when we completed the &#8220;.com&#8221;. The best practice here is to suggest a valid value for the initial &#8220;http://mitcho&#8221;, like &#8220;http://mitcho.com&#8221;.<br/>(In reality, I should have said &#8220;initial-to-later nature&#8221; to be fair to right-to-left languages, but you get the idea. Speaking of which, serious consideration of Ubiquity in right-to-left languages is long overdue.)&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>In reality, due to the way parses are scored and the fact that <code>noun_arb_text</code> accepts anything with score 0.3, a suggestion with score below 0.3 is probably not worth even giving out. Notable exceptions are for custom noun types which are used in commands which take multiple arguments&#8230; in these cases, even scores below 0.3 could add up and overtake a <code>noun_arb_text</code> parse, but it&#8217;s rare.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>The idea that successively longer inputs should yield successively higher scores only makes sense (1) when they are converging on the same suggestion output and (2) when these are truly suggestions, not just acceptances. For nountypes which accept the input verbatim, suggestion scores need not increase&#8230; for example &#8220;1&#8221; is just as good a &#8220;number&#8221; as &#8220;1234&#8221; is, so both of their respective suggestions, &#8220;1&#8221; and &#8220;1234&#8221; could be given the same score.&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:5">
<p>Unfortunately the Nountype Tuner currently only compares the suggestions of <em>one input</em> across a number of nountypes, not a number of inputs across the same nountype. In the future I&#8217;d like to make the Nountype Tuner be able to produce these sorts of score curves as well.&#160;<a href="#fnref:5" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-2/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 2'>Nountype Quirks: Day 2</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-3/' rel='bookmark' title='Permanent Link: Nountype Quirks: Day 3: Geo Day'>Nountype Quirks: Day 3: Geo Day</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/judging-noun-types/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Report from SIGIR Workshop on Information Access in a Multilingual World</title>
		<link>http://mitcho.com/blog/projects/report-from-sigir-workshop-on-information-access-in-a-multilingual-world/</link>
		<comments>http://mitcho.com/blog/projects/report-from-sigir-workshop-on-information-access-in-a-multilingual-world/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 19:42:27 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[information access]]></category>
		<category><![CDATA[linguistics]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[SIGIR]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[workshop]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2547</guid>
		<description><![CDATA[Yesterday I participated in and presented at a workshop on Information Access in a Multilingual World at ACM SIGIR in Boston. The focus of the workshop was on cross-language information retrieval (CLIR). Cross-language information retrieval systems enable users to retrieve relevant information across different languages for a certain task or query. Even if you have [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/' rel='bookmark' title='Permanent Link: Presenting in Boston at SIGIR Workshop'>Presenting in Boston at SIGIR Workshop</a></li>
<li><a href='http://mitcho.com/blog/link/the-hit-list-better-software-through-less-ui/' rel='bookmark' title='Permanent Link: The Hit List: Better Software Through Less UI'>The Hit List: Better Software Through Less UI</a></li>
<li><a href='http://mitcho.com/blog/projects/mozilla-by-the-numbers/' rel='bookmark' title='Permanent Link: Mozilla By The Numbers'>Mozilla By The Numbers</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Yesterday I participated in and presented at <a href="http://www.sics.se/events/clir2009">a workshop on Information Access in a Multilingual World</a> at <a href="http://sigir2009.org/">ACM SIGIR</a> in Boston. The focus of the workshop was on <a href="http://en.wikipedia.org/wiki/cross-language information retrieval">cross-language information retrieval</a> (CLIR). Cross-language information retrieval systems enable users to retrieve relevant information across different languages for a certain task or query. Even if you have a budget to translate some documents from a foreign language to your language, how do you find the relevant documents to translate in the first place if you don&#8217;t speak (or read) that source language? This is the type of problem that CLIR aims to solve.</p>

<p><span id="more-2547"></span></p>

<p>The keynote speaker was <a href="http://www.linkedin.com/in/ralfsteinberger">Ralf Steinberger</a> of the <a href="http://www.jrc.ec.europa.eu/">European Commission&#8217;s Joint Research Centre</a>, presenting the <a href="http://emm.jrc.it/overview.html">European Media Monitor</a> family of applications. EMM is a suite of different applications all based on a core platform which aggregates news stories from a variety of sources around the world in a few dozen different languages. The system uses various CLIR techniques to then cluster stories by event, regardless of language or source country. Large news agencies and organizations, as well as the European Commission itself, use the system to track upcoming news stories as well as health concerns. In the European Union which has over a dozen different &#8220;official&#8221; languages, there is a great need for this type of service. The applications are available to the public so I invite you to play around with them <a href="http://emm.jrc.it/overview.html">at the EMM site</a>.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>The workshop&#8217;s paper presentations were quite diverse and all interesting. <a href="http://storm.cis.fordham.edu/~filatova/">Elena Filatova</a> presented an interesting approach to measuring the &#8220;trustworthiness&#8221; of statements in Wikipedia entries, by comparing the overlap in content statements between different language entries (more overlap => more trustworthy) which can be used to create <a href="http://en.wikipedia.org/wiki/inverted pyramid">inverted pyramid</a> summaries. Perspectives from different use cases were also examined through presentations on news analysts and health organizations, patent searches, and medical information for personal use, as well as discussion of the need for CLIR for historical and religious texts.</p>

<p>One interesting thread throughout the day&#8217;s sessions was the issue of loanword processes and the possible use of romanization as an interlingua. Cross-language <a href="http://en.wikipedia.org/wiki/named entity recognition">named entity recognition</a> is a major problem in CLIR. Many novel words and names (common in news articles) go through processes of loanword adaptation and transliteration and are hard to identify and also are not in the systems&#8217; dictionaries. A few of the talks touched on these problems, including a great talk by Kashif Riaz of <a href="http://www.umn.edu">the U of M</a> on the salient (and great) differences between Hindi and Urdu. <a href="http://ucdata.berkeley.edu/gey.html">Frederic Gey</a> described a number of different approaches to comparing strings via a romanization interlingua.</p>

<p>Another interesting thread was the idea of the target user. The needs of CLIR applications can vary greatly depending on its use case and the users&#8217; savvy. The needs of a patent search office, where many professional searchers are already multilingual, is clearly different from the needs of an executive hoping to stay on top of the world news related to their organization. It was brought up, however, that in this age of open data and API&#8217;s, if a CLIR resource provides a good API, it need not necessarily supply the perfect interface for every type of user, as different third parties could also develop such targeted interfaces.</p>

<p>While most of the presentations and research interests in the room were on users accessing resources in various languages, I presented on <a href="http://ubiquity.mozilla.com">Ubiquity</a>. The talk was intended to highlight the idea that the opposite problem of users with different languages getting at the same kinds of information and getting equally powerful user experiences is also a different but worthwhile problem. Below are the slides from this talk. As a web archive of all the papers will be set up soon, I believe it&#8217;s safe to put up my paper as well, so please check it out. It&#8217;s a good short (four pages) overview of the innovative approaches we&#8217;ve taken to build a localizable natural language interface.</p>

<div style="width:650px;text-align:left" id="__ss_1766079"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/mitcho/ubiquity-designing-a-multilingual-natural-language-interface" title="Ubiquity: Designing a Multilingual Natural Language Interface">Ubiquity: Designing a Multilingual Natural Language Interface</a><object style="margin:0px" width="649" height="542"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sigirnovideo-090724143940-phpapp02&#038;rel=0&#038;stripped_title=ubiquity-designing-a-multilingual-natural-language-interface" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sigirnovideo-090724143940-phpapp02&#038;rel=0&#038;stripped_title=ubiquity-designing-a-multilingual-natural-language-interface" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="649" height="542"></embed></object></div>

<div class="files">
<div class="file pdf">
<a href='http://mitcho.com/academic/erlewine-sigir.pdf'>&#8220;Ubiquity: Designing a Multilingual Natural Language Interface.&#8221;</a> Presented at <a href='http://www.sics.se/events/clir2009'>SIGIR Workshop on Information Access in a Multilingual World</a>, Boston, July 2009. <i>To appear in a proceedings.</i></li>
<span class="specs">240&#160;kb - pdf</span>
</div>
</div>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Unfortunately, there is no public API available for these resources. We asked. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/' rel='bookmark' title='Permanent Link: Presenting in Boston at SIGIR Workshop'>Presenting in Boston at SIGIR Workshop</a></li>
<li><a href='http://mitcho.com/blog/link/the-hit-list-better-software-through-less-ui/' rel='bookmark' title='Permanent Link: The Hit List: Better Software Through Less UI'>The Hit List: Better Software Through Less UI</a></li>
<li><a href='http://mitcho.com/blog/projects/mozilla-by-the-numbers/' rel='bookmark' title='Permanent Link: Mozilla By The Numbers'>Mozilla By The Numbers</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/report-from-sigir-workshop-on-information-access-in-a-multilingual-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Converting your Ubiquity command to Ubiquity 0.5</title>
		<link>http://mitcho.com/blog/projects/converting-your-ubiquity-command-to-ubiquity-0-5/</link>
		<comments>http://mitcho.com/blog/projects/converting-your-ubiquity-command-to-ubiquity-0-5/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 12:15:37 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2521</guid>
		<description><![CDATA[Converting your Ubiquity command to Ubiquity 0.5 from mitcho on Vimeo. This video walks through the process of converting your Ubiquity commands to Ubiquity 0.5 with Parser 2. For more information, please consult the command conversion tutorial. Related posts:A Demonstration of Ubiquity Parser 2 Changes to Ubiquity Parser 2 and the Playpen Foxkeh demos Ubiquity [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/' rel='bookmark' title='Permanent Link: A Demonstration of Ubiquity Parser 2'>A Demonstration of Ubiquity Parser 2</a></li>
<li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Permanent Link: Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
<li><a href='http://mitcho.com/blog/projects/foxkeh-demos-ubiquity-parser-the-next-generation/' rel='bookmark' title='Permanent Link: Foxkeh demos Ubiquity Parser: The Next Generation'>Foxkeh demos Ubiquity Parser: The Next Generation</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><object width="649" height="365"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5691107&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5691107&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="649" height="365"></embed></object><br /><a href="http://vimeo.com/5691107">Converting your Ubiquity command to Ubiquity 0.5</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>This video walks through the process of converting your Ubiquity commands to Ubiquity 0.5 with Parser 2. For more information, please consult <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2_API_Conversion_Tutorial">the command conversion tutorial</a>.</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/' rel='bookmark' title='Permanent Link: A Demonstration of Ubiquity Parser 2'>A Demonstration of Ubiquity Parser 2</a></li>
<li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Permanent Link: Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
<li><a href='http://mitcho.com/blog/projects/foxkeh-demos-ubiquity-parser-the-next-generation/' rel='bookmark' title='Permanent Link: Foxkeh demos Ubiquity Parser: The Next Generation'>Foxkeh demos Ubiquity Parser: The Next Generation</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/converting-your-ubiquity-command-to-ubiquity-0-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Visual Guide to Community Command Localization</title>
		<link>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/</link>
		<comments>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 22:11:30 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Matt Mullenweg]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2475</guid>
		<description><![CDATA[A natural language interface is only &#8220;natural&#8221; if it&#8217;s in your natural language. With this mantra in mind, we&#8217;ve been making steady progress on the challenging problem of Ubiquity localization. The first fruit of this research is in the localization of the parser and bundled commands in Ubiquity 0.5. Here today is a visual guide [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/ubiquity-localization-update/' rel='bookmark' title='Permanent Link: Ubiquity Localization Update'>Ubiquity Localization Update</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Permanent Link: Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural language interface</a> is only &#8220;natural&#8221; if it&#8217;s in your natural language. With this mantra in mind, we&#8217;ve been making steady progress on the challenging problem of <a href="http://ubiquity.mozilla.com">Ubiquity</a> localization. The first fruit of this research is in the localization of the parser and bundled commands <a href="http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/">in Ubiquity 0.5</a>. Here today is a visual guide on command localization in Ubiquity and different options we can take in attacking the community command localization problem.<span id="more-2475"></span></p>

<h3>Command localization in Ubiquity 0.5</h3>

<p>A few important design decisions have already been made in implementing command localization in Ubiquity 0.5. The first was the choice of the <a href="http://en.wikipedia.org/wiki/gettext">gettext</a> po (portable object) file format. The po format is a de facto industry standard with many tools built for the format and this design choice hopefully lower the bar for prospective localizers.</p>

<p>Second, in order to simplify the matching of localizations and commands, we require that each command feed have one localization po file, rather than splitting the localizations of different commands across multiple po files.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/dist.png" alt="dist.png" border="0" width="650" height="250" /></p>

<p>Finding the appropriate localization po file for a JavaScript command feed is very simple with bundled commands as the files are managed in our main repository so we know exactly where to find them. We just take the command feed&#8217;s filename sans extension—the <em>feed key</em>—and look for <code>localizations/</code><em>lang</em><code>/</code><em>feed key</em><code>.po</code>, where <em>lang</em> is the active language code. This gives us a simple one to one relationship between the JavaScript command feed source and the appropriate localization.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/local.png" alt="local.png" border="0" width="650" height="218" /></p>

<h3>Background</h3>

<p>The ability of users to <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Author_Tutorial">easily write their own Ubiquity commands</a> has always been a huge strength of the Ubiquity platform. Users can also &#8220;subscribe&#8221; to commands written by other users on other servers. In this case, local copies of those command sources are made.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/distcmds.png" alt="distcmds.png" border="0" width="650" height="420" /></p>

<p>The <a href="http://ubiquity.mozilla.com/herd/">herd</a> was developed as a dynamic aggregator of community Ubiquity commands. The herd keeps its own copy of each command source. The herd groups mirrors of command feeds on multiple servers together as well, giving each unique command feed a unique ID.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/herd.png" alt="herd.png" border="0" width="650" height="240" /></p>

<h3>Localizing distributed resources</h3>

<p>This distributed nature of the command feeds is exactly what complicates the localization of community commands. The original sources themselves are distributed, and we also want a community of localizers to be able to localize the commands—i.e., for the localizations to be (in some sense) distributed. Here I will present three options which I believe could be the basis for a winning solution, in order of more distributed to less distributed.</p>

<p>All three of these options have the property that localizations do not need to be &#8220;approved&#8221; or &#8220;managed&#8221; by the command author. For example, a possible standard where URL&#8217;s of localizations must be in the command feed is not considered. I believe this is a crucial property of any approach we decide on.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<h4>Option 1: a completely distributed option</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option1.png" alt="herd.png" border="0" width="650" height="300" /></p>

<p>In this option, localizers simply put the po files on their own servers (or some code snippet site such as github) and the user must then subscribe to those localizations much as they subscribe to commands now.</p>

<h4>Option 2: registration and discovery through the herd</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option2.png" alt="herd.png" border="0" width="650" height="400" /></p>

<p>In this option, localizers put po files up on their own servers and then register that po file&#8217;s URL with the herd. The herd keeps track of each command feed&#8217;s localizations in different languages.</p>

<h4>Option 3: localizations on the herd</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option3.png" alt="herd.png" border="0" width="650" height="340" /></p>

<p>In this option, po localizations are uploaded right onto the herd. The herd is the centralized repository of all localizations for each command feed.</p>

<h3>Users first</h3>

<p>In coming up with a criteria for judging different models of community command localization, I think it is helpful to think of the end-user experience. Right now to subscribe to a new command a user must find the command (perhaps via the herd) and click on the subscribe button, then in most cases confirm that they are aware of the possible dangers and confirm subscription.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> What work is required for a user to subscribe to a new command <em>and get it in their language</em>?</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/subscribe.png" alt="herd.png" border="0" width="650" height="40" /></p>

<p>Under option one, the user would somehow have to find the localization scattered someplace on the internet of their own accord, and then install that localization by themself. In my mind, this is clearly a no go. With options two or three, however, when a user subscribes to a command feed Ubiquity can check with the herd to see whether there are any localizations available. The localizations could be offered to the user or the localization for the currently active language could be automatically installed. There are, on the other hand, disadvantages to requiring a centralized authority, exemplified by the fact that the current iteration of the herd itself has often been down.</p>

<h3>Summary and a call for comments</h3>

<p>As laid out in this visual guide, I personally have a couple main criteria which I believe we should follow:</p>

<ol>
<li><strong>localization independence</strong>: Command authors should not have to manage their commands&#8217; localizations. (See footnote 1.)</li>
<li><strong>friendly discovery and subscription</strong>: Users should not have to go out and find localizations by themselves. Localizations should be offered to the user.</li>
</ol>

<p>With these criteria, I&#8217;m pretty sure the only logical conclusion is that we need some level of centralization, pointing to options two and three. <strong>If you think of another option which satisfies these criteria, or disagree with the criteria above, I would love to know.</strong> In addition, <strong>have you encountered similar problems of localizing distributed resources elsewhere? What worked there?</strong></p>

<p>If this problem has been solved before, there is no need to reinvent the wheel. As far as I can tell, however, this could be a particularly hairy problem.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>This strong view is based on my own experience as a <a href="http://mitcho.com/code/yarpp/">WordPress plugin author</a> and a subsequent conversation with <a href="http://en.wikipedia.org/wiki/Matt Mullenweg">Matt Mullenweg</a>. The WordPress plugin ecosystem requires that plugin authors orchestrate localizations and bundle them into releases. In the case of my plugin, this requires regular contact with over a dozen localizers.<br/>The case of WordPress plugins is actually much like that of Ubiquity commands&#8230; the plugins can be served on any server, distributed, but there is also a central repository, <a href="http://wordpress.org/extend/">wordpress.org/extend</a>.<br/>Matt and I agreed that if localizers could somehow localize plugins without going through the command author, most of whom produce their plugins by volunteering their time, the localization of plugins could be much more popular. Indeed, some localizers go ahead and publish po files for popular plugins, but those localizations are hard to find as there is no repository for the localizations either.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>As I&#8217;ve <a href="http://mitcho.com/blog/projects/friendlier-command-feed-subscription/">written before about Ubiquity&#8217;s command subscription</a>, there is much we can improve in this area of Ubiquity&#8217;s user experience.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/ubiquity-localization-update/' rel='bookmark' title='Permanent Link: Ubiquity Localization Update'>Ubiquity Localization Update</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Permanent Link: Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>日本語サポートを含む Ubiquity 0.5 リリース</title>
		<link>http://mitcho.com/blog/projects/%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%b5%e3%83%9d%e3%83%bc%e3%83%88%e3%82%92%e5%90%ab%e3%82%80-ubiquity-0-5-%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9/</link>
		<comments>http://mitcho.com/blog/projects/%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%b5%e3%83%9d%e3%83%bc%e3%83%88%e3%82%92%e5%90%ab%e3%82%80-ubiquity-0-5-%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 06:01:33 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[Japan]]></category>
		<category><![CDATA[Japanese language]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[Tokyo]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2444</guid>
		<description><![CDATA[Mozilla Japan ブログで Ubiquity を紹介する投稿を上げたので、ここでもクロスポストします。 Here&#8217;s a cross-post of a Ubiquity 0.5 announcement (in particular regarding the new Japanese support) I wrote for the Mozilla Japan blog. Mozilla Labs の実験的プロジェクトのひとつ、 Ubiquity の最新版、バージョン 0.5 を昨日リリースしました。 (Mozilla Labs 正式発表 [英文]) Ubiquity はウェブをより有益に、より使いやすくするために自然言語で Firefox を操作するインターフェースを提供します。ウェブ上のオープン API と機能が増えて行く一方でどのようなインターフェースが必要であるのか。その答えを追求した結果、テキスト入力の正確さとスピードと自然言語の心地よさを合わせたインターフェースができあがりました。例えば「麹町を地図で表示」、「これを (誰々) へメール」などを自分の言葉で入力してブラウザを操作することができます。新しいコマンド (動詞) も簡単に JavaScript で書けるので、拡張性も非常に高いプラットフォームです。 ユーザにとって「自然な構文」 (&#8220;natural syntax&#8221; [英文]) という目標の下、数ヶ月の研究の結果、Ubiquity [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/link/contribute-to-ubiquity-no-coding-required/' rel='bookmark' title='Permanent Link: Contribute to Ubiquity! No Coding Required!'>Contribute to Ubiquity! No Coding Required!</a></li>
<li><a href='http://mitcho.com/blog/projects/talking-ubiquity-in-japan-%e6%8b%a1%e5%bc%b5%e6%a9%9f%e8%83%bd%e5%8b%89%e5%bc%b7%e4%bc%9a%e3%81%ab%e3%81%a6%e7%99%ba%e8%a1%a8/' rel='bookmark' title='Permanent Link: Talking Ubiquity in Japan: 拡張機能勉強会にて発表'>Talking Ubiquity in Japan: 拡張機能勉強会にて発表</a></li>
<li><a href='http://mitcho.com/blog/link/ubiquity-interview-in-chinese/' rel='bookmark' title='Permanent Link: Ubiquity interview in Chinese'>Ubiquity interview in Chinese</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><small><a href="http://mozilla.jp/blog/">Mozilla Japan ブログ</a>で <a href="http://mozilla.jp/blog/entry/4408/">Ubiquity を紹介する投稿</a>を上げたので、ここでもクロスポストします。 Here&#8217;s a cross-post of <a href="http://mozilla.jp/blog/entry/4408/">a Ubiquity 0.5 announcement</a> (in particular regarding the new Japanese support) I wrote for the <a href="http://mozilla.jp/blog/">Mozilla Japan blog</a>.</small></p>

<p><a href="http://ubiquity.mozilla.com"><img src='http://farm4.static.flickr.com/3433/3211626795_66b7c744dd.jpg' width='142' height='200' style='float: right; padding-left: 1em;'/></a></p>

<p><a href="http://labs.mozilla.com">Mozilla Labs</a> の実験的プロジェクトのひとつ、 <a href="http://ubiquity.mozilla.com">Ubiquity</a> の最新版、バージョン 0.5 を昨日リリースしました。 (<a href="http://labs.mozilla.com/2009/07/ubiquity-0-5/">Mozilla Labs 正式発表</a> [英文])</p>

<p>Ubiquity はウェブをより有益に、より使いやすくするために自然言語で Firefox を操作するインターフェースを提供します。ウェブ上のオープン API と機能が増えて行く一方でどのようなインターフェースが必要であるのか。その答えを追求した結果、テキスト入力の正確さとスピードと自然言語の心地よさを合わせたインターフェースができあがりました。例えば「麹町を地図で表示」、「これを (誰々) へメール」などを自分の言葉で入力してブラウザを操作することができます。新しいコマンド (動詞) も簡単に JavaScript で書けるので、拡張性も非常に高いプラットフォームです。</p>

<p>ユーザにとって「自然な構文」 (<a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">&#8220;natural syntax&#8221;</a> [英文]) という目標の下、数ヶ月の研究の結果、Ubiquity 0.5 では複数の言語の異なる構文に対応できるパーサを実装しました。Ubiquity 内蔵のコマンドもローカライズ可能になり、0.5 ではすべての内蔵コマンドの日本語、デンマーク語とポルトガル語版が搭載されています。</p>

<p>リリース直前に Ubiquity の日本語紹介ビデオを作成しましたので、どうぞご覧ください。日本語モードでの使用方法も説明されています。</p>

<p><object width="625" height="351"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5420966&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5420966&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="625" height="351"></embed></object></p>

<p><a href="http://vimeo.com/5420966">Ubiquity 0.5 日本語紹介ビデオ</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>日本語サポートが入った Ubiquity 0.5 を是非ご使用ください。このインターフェースをより多くのユーザが「自然に」使えるよう、これからも開発を続けていきたいと思います。</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/link/contribute-to-ubiquity-no-coding-required/' rel='bookmark' title='Permanent Link: Contribute to Ubiquity! No Coding Required!'>Contribute to Ubiquity! No Coding Required!</a></li>
<li><a href='http://mitcho.com/blog/projects/talking-ubiquity-in-japan-%e6%8b%a1%e5%bc%b5%e6%a9%9f%e8%83%bd%e5%8b%89%e5%bc%b7%e4%bc%9a%e3%81%ab%e3%81%a6%e7%99%ba%e8%a1%a8/' rel='bookmark' title='Permanent Link: Talking Ubiquity in Japan: 拡張機能勉強会にて発表'>Talking Ubiquity in Japan: 拡張機能勉強会にて発表</a></li>
<li><a href='http://mitcho.com/blog/link/ubiquity-interview-in-chinese/' rel='bookmark' title='Permanent Link: Ubiquity interview in Chinese'>Ubiquity interview in Chinese</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%b5%e3%83%9d%e3%83%bc%e3%83%88%e3%82%92%e5%90%ab%e3%82%80-ubiquity-0-5-%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</title>
		<link>http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/</link>
		<comments>http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 19:45:25 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[linguistics]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountype]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[participate]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[verb]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2432</guid>
		<description><![CDATA[Yesterday we released Ubiquity 0.5, a major update to the already popular Ubiquity platform. Among numerous other features, Ubiquity 0.5 includes the first fruit of months of research on building a multilingual parser and natural language interface. In this blog post I&#8217;ll give a quick overview of new internationalization-related features in Ubiquity 0.5 as well [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-ubiquity-commands-and-nountypes/' rel='bookmark' title='Permanent Link: Localizing Ubiquity: commands and nountypes'>Localizing Ubiquity: commands and nountypes</a></li>
<li><a href='http://mitcho.com/blog/projects/big-issues-and-small-issues-with-parser-2/' rel='bookmark' title='Permanent Link: Big Issues and Small Issues with Parser 2'>Big Issues and Small Issues with Parser 2</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Yesterday we <a href="https://labs.mozilla.com/2009/07/ubiquity-0-5/">released Ubiquity 0.5</a>, a major update to the already popular Ubiquity platform. Among <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Release_Notes">numerous other features</a>, Ubiquity 0.5 includes the first fruit of <a href="http://mitcho.com/blog/tag/ubiquity/">months of research on building a multilingual parser and natural language interface</a>. In this blog post I&#8217;ll give a quick overview of new internationalization-related features in Ubiquity 0.5 as well as a quick roadmap of future considerations.</p>

<p>Of course, one of the best ways to learn about the new features is to experience them&#8230; try Ubiquity 0.5 now!</p>

<p><a href="https://ubiquity.mozilla.com/xpi/0.5/ubiquity-0.5.xpi" style="cursor:pointer;background: #01d835;border: 1px solid;border-color:#01d835 #4ece71 #4ece71 #01d835;-moz-border-radius:4px;padding:10px;text-transform:uppercase;font-size:1.3em;color:white;text-shadow:#1e792c 1px 1px 1px;">Install now!</a></p>

<p><span id="more-2432"></span></p>

<h3>Preface: What&#8217;s What</h3>

<p>To give users a completely localized experience, there are many different components that need to be made to work with different languages. In a single Ubiquity input, like</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="en" style="font-family:monospace;">translate hello from English to Spanish</pre></td></tr></table></div>


<p>there are actually many different components that need to all be localized in order to comprehend the equivalent sentence in a different language. The diagram below will give you a sense for the different components that need to be localized: the parser, verbs, and nountypes.</p>

<table>
<tr><th>input:</th><td>translate</td><td>hello</td><td>from</td><td>English</td><td>to</td><td>Spanish</td></tr>
<tr><th>element type:</th><td>verb</td><td>free argument</td><td>delimiter</td><td>structured argument</td><td>delimiter</td><td>structured argument</td></tr>
<tr><th>component to localize:</th><td>verb name</td><td>&nbsp;</td><td>parser</td><td>nountype</td><td>parser</td><td>nountype</td></tr>
</table>

<h3>What&#8217;s New</h3>

<p>Ubiquity 0.5&#8217;s improved language support can be thought of as the product of two more or less orthogonal developments: the brand-new parser, Parser 2, as well as local command localization support.</p>

<h4>Parser 2</h4>

<p>Parser 2 (née <a href="http://mitcho.com/blog/projects/this-week-on-ubiquity-parser-the-next-generation/">Parser: The Next Generation</a>) is a completely new parser designed to support different languages easily. Taking a serious look at the similarities and differences between different languages, we created a universal <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2">parser design</a> which takes a minimal set of settings for particular languages to &#8220;learn&#8221; that language&#8217;s grammar.</p>

<p>The key insight to Parser 2&#8217;s design is that, for the limited range of inputs Ubiquity should understand, languages deal with them in remarkably similar ways. The input we&#8217;re dealing with here are all commands or actions without quantification or negation. These are all comprised of a single verb and a series of arguments with certain markings to designate their roles in the sentence. For example, here&#8217;s our example Ubiquity input:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="en" style="font-family:monospace;">translate hello from English to Spanish</pre></td></tr></table></div>


<p>In this example, &#8220;translate&#8221; is the verb, which we recognize by looking at our bank of known verbs, and the rest of the input can be split up into three different arguments: &#8220;hello,&#8221; &#8220;from English,&#8221; and &#8220;to Spanish.&#8221; Of these, the markers &#8220;from&#8221; and &#8220;to&#8221; tell us that &#8220;English&#8221; is a <em>source</em> of some sort and &#8220;Spanish&#8221; is a <em>goal</em>, while the unmarked &#8220;hello&#8221; is simply an <em>object</em>—the target of the action. By identifying arguments by these abstract <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2/Semantic_Roles"><em>semantic roles</em></a>, we&#8217;re able to quickly identify different kinds of arguments in different languages. For example, the following is the exact same example but using the Japanese syntax and markers:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
</pre></td><td class="code"><pre class="en" style="font-family:monospace;">helloをEnglishからSpanishにtranslate</pre></td></tr></table></div>


<p>Ubiquity knows what the different markers mean in Japanese, like &#8220;を&#8221; > <code>object</code>, &#8220;から&#8221; > <code>source</code>, &#8220;に&#8221; > <code>goal</code>, and can easily interpret this to mean the exact same command as (1). With just a few lines of code, <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2/Localization_Tutorial">you can teach</a> Ubiquity how to recognize these different semantic roles in your language. This innovation also means that Ubiquity commands can be <a href="http://mitcho.com/blog/projects/writing-commands-with-semantic-roles/">written once for one language and automatically used with another language&#8217;s parser</a>, bringing us half-way to the goal of command localization.</p>

<p>Note also that Japanese (as in example (2)) is verb-final and uses no spaces between words. We&#8217;ve tried to make Parser 2 itself agnostic towards these types of different ways in which languages vary.</p>

<p>Parser 2 also adds <a href="http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/">better argument-first suggestions</a>, inspired by some <a href="http://mitcho.com/blog/projects/ubiquity-in-firefox-japanese/">earlier thoughts on Ubiquity in Japanese</a>. Ubiquity will now start to parse arguments in the input even if a verb isn&#8217;t found, and suggest verbs based on that input. For example, if you enter &#8220;hello to Spanish,&#8221; it&#8217;ll recognize that you have an <em>object</em> of &#8220;hello&#8221; and a <em>goal</em> of &#8220;Spanish&#8221; which can be understood as a language name, so it&#8217;ll suggest the verb &#8220;translate.&#8221; This is the way it should be. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><small>For more information and background, feel free to check out some of my previous blog posts <a href="http://mitcho.com/blog/tag/ubiquity+parser/">on the new parser</a> and <a href="http://mitcho.com/blog/tag/ubiquity+linguistics/">on the different linguistic considerations</a>. I also have a four-page academic paper giving an overview of some innovations in the parser—email me at <code>x@x.com</code> where <code>x=mitcho</code> if you&#8217;d like to get a copy.</small></p>

<h4>Internationalization of bundled commands</h4>

<p>The move to use <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2/Semantic_Roles">semantic roles</a> in the <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_Source_Tip_Author_Tutorial">new command API</a>, described above, means that the same Ubiquity command code can be used with inputs in different languages. Two things are left, then, to make a completely localized input work: (1) translation (localization) of different strings in the commands and (2) localization of the nountypes.</p>

<p>In Ubiquity 0.5, we built a localization infrastructure for commands (1, above) but have not yet tackled the nountypes (2). Ubiquity 0.5 uses the <a href="http://en.wikipedia.org/wiki/gettext">gettext</a> <code>po</code> (portable object) file format for localizations, which many localizers in the UNIX world are very familiar with. This <a href="http://groups.google.com/group/ubiquity-i18n/browse_thread/thread/79c7cea117ad04bb#">choice of file format</a> potentially opens Ubiquity localization up to many who are new to localization or are unfamiliar with other Mozilla localization. Ubiquity is able to produce localization templates by itself and we also have <a href="http://geeksbynature.dk/?p=35">a great tool</a> to check the completeness of different localizations.</p>

<p>A huge caveat, however, is that this localization support currently only works with the commands bundled with Ubiquity itself.</p>

<h3>What&#8217;s Next</h3>

<p>We&#8217;re going to continue working to make Ubiquity <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">more natural</a> for more users. The tasks we have ahead of us are the localization of nountypes and community commands.</p>

<h4>Nountype localization</h4>

<p>With the new semantic role argument specifications, command localization simply became a question of translating some strings, which many localizers are used to. After all, we want localizations to affect the <em>presentation</em> of commands, not the logic of the commands. When it comes to nountypes, however, it is quite possible that we would actually want the nountype localization to affect its behavior.</p>

<p>Consider, for example, an imaginary <code>day_of_the_week</code> nountype. In English, this nountype might accept or suggest strings like &#8220;Monday&#8221; or &#8220;Tuesday,&#8221; while a French localization would accept &#8220;lundi&#8221; or &#8220;mardi.&#8221; More complicated still, consider a <code>date</code> nountype. In English this nountype may have custom logic to parse strings like &#8220;June 1st&#8221; while another language may have to parse very different kinds of strings. These nountype localizations thus involve not just string translations, but actual changes in their <em>logic</em>, making the <code>po</code> format approach we took to command localization a poor fit.</p>

<p>Making nountypes localizable, however, will make Ubiquity significantly more &#8220;natural&#8221; for many users. In the coming weeks and months we&#8217;ll be discussing and debating different options to accomplish this.</p>

<h4>Community command localization</h4>

<p>Even though the file format and infrastructure for command localization itself has been fleshed out with Ubiquity 0.5, the distributed nature of all these community commands adds an additional complication. Do we want community command localizations to be completely distributed, or should they be centralized? If they&#8217;re distributed, how do you find them? These are the types of questions we&#8217;ll need to ask and answer. The ease of creating a new Ubiquity command and sharing it with the world is a huge asset of the platform, so we&#8217;ll definitely be thinking about how best to localize these community commands as well. In the next day or two I&#8217;ll be writing up a more detailed blog post on what we need from a good community command localization solution.</p>

<h3>Summary</h3>

<p>For the more visually inclined (including myself), here&#8217;s a handy diagram to summarize what components are localizable now, what will be in the future, and what this means for Ubiquity users of different languages.</p>

<table>
<tr><th rowspan='2'>localized components</th><th rowspan='2'>Japanese input that Ubiquity will understand</th><th colspan='2'>support coverage</th></tr>
<tr><th>for bundled commands</th><th>for community commands</th></tr>
<tr><th><i>no localization</i></th><td>translate hello from English to Spanish</td><th rowspan='3' style='background: #99ff99'>Ubiquity 0.5!</th><th rowspan='2' style='background: #99ff99'>Ubiquity 0.5!</td></tr>
<tr><th>parser</th><td>helloをEnglishからSpanishにtranslate</td></tr>
<tr><th>parser + verbs</th><td>helloをEnglishからSpanishに訳す</td><th rowspan='2' style='background: #f99'><i>the future</i></th></tr>
<tr><th>parser + verbs + nountypes</th><td>helloを英語からスペイン語に訳す</td><th rowspan='1' style='background: #f99'><i>the future</i></th></tr>
</table>

<h3>Get Involved</h3>

<p>Whether you&#8217;re a speaker of an as-yet unsupported language, a veteran localization contributor, or simply interested in seeing how we can offer this natural language interface to more languages and more users, there are lots of ways to get involved. If you have some JavaScript experience and want to teach Ubiquity your native languages&#8217; grammar, read our <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2/Localization_Tutorial">parser localization tutorial</a>. If you would like to contribute localizations for our built-in commands, there&#8217;s a <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Command_Localization_Tutorial">command localization tutorial</a>. To discuss how best to localize nountypes and community commands, or to ask questions about or discuss command and parser localization, join us on the <a href="http://groups.google.com/group/ubiquity-i18n">Ubiquity-i18n mailing list</a>.</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Permanent Link: Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-ubiquity-commands-and-nountypes/' rel='bookmark' title='Permanent Link: Localizing Ubiquity: commands and nountypes'>Localizing Ubiquity: commands and nountypes</a></li>
<li><a href='http://mitcho.com/blog/projects/big-issues-and-small-issues-with-parser-2/' rel='bookmark' title='Permanent Link: Big Issues and Small Issues with Parser 2'>Big Issues and Small Issues with Parser 2</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Presenting in Boston at SIGIR Workshop</title>
		<link>http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/</link>
		<comments>http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 03:10:25 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[Boston]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[travelogue]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2405</guid>
		<description><![CDATA[I have been accepted to present a short paper entitled &#8220;Ubiquity: Designing a Multilingual Natural Language Interface&#8221; at the ACM SIGIR Workshop on Information Access in a Multilingual World in Boston on July 23rd. I&#8217;ll probably be there in Boston a few days before or after as well in order to find an apartment for [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/report-from-sigir-workshop-on-information-access-in-a-multilingual-world/' rel='bookmark' title='Permanent Link: Report from SIGIR Workshop on Information Access in a Multilingual World'>Report from SIGIR Workshop on Information Access in a Multilingual World</a></li>
<li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='Permanent Link: WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Permanent Link: Jetpacking in Boston'>Jetpacking in Boston</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I have been accepted to present a short paper entitled &#8220;Ubiquity: Designing a Multilingual Natural Language Interface&#8221; at the ACM <a href="http://www.sigir2009.org/">SIGIR</a> Workshop on <a href="http://www.sics.se/events/clir2009">Information Access in a Multilingual World</a> in Boston on July 23rd. I&#8217;ll probably be there in Boston a few days before or after as well in order to find an apartment for the fall. If anyone is in Boston at that time and would like to meet up, or if you&#8217;re near Cambridge and looking for an apartment-mate, please let me know. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<p>If you would like to see a preprint of the paper, please contact me at <code>x@x.com</code> where <code>x=mitcho</code>.</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/report-from-sigir-workshop-on-information-access-in-a-multilingual-world/' rel='bookmark' title='Permanent Link: Report from SIGIR Workshop on Information Access in a Multilingual World'>Report from SIGIR Workshop on Information Access in a Multilingual World</a></li>
<li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='Permanent Link: WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Permanent Link: Jetpacking in Boston'>Jetpacking in Boston</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubiquity 0.5 日本語紹介ビデオ</title>
		<link>http://mitcho.com/blog/projects/ubiquity-0-5-%e6%97%a5%e6%9c%ac%e8%aa%9e%e7%b4%b9%e4%bb%8b%e3%83%93%e3%83%87%e3%82%aa/</link>
		<comments>http://mitcho.com/blog/projects/ubiquity-0-5-%e6%97%a5%e6%9c%ac%e8%aa%9e%e7%b4%b9%e4%bb%8b%e3%83%93%e3%83%87%e3%82%aa/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 09:08:03 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[Japanese language]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2389</guid>
		<description><![CDATA[今夜リリースされる Ubiquity の最新版、0.5 に備えて日本語で Ubiquity のスクリーンキャストを作ってみました。 Ubiquity 0.5 は特に多言語化を重視したリリースで、 Ubiquity 内蔵のコマンドが日本語とデンマーク語で使えるようになっています。是非インストールしてみてください！ 追伸： ７月３日現在、 Ubiquity 0.5 のリリースを遅らせる方向になったので、残念ながら今日はリリースされません。是非リリース後インストールしてみてください。 Ubiquity 0.5 日本語紹介ビデオ from mitcho on Vimeo. As Ubiquity 0.5 will be released soon (Thursday morning in Mountain View), I decided it was a good time to put together a screencast in Japanese demoing the use of the new [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Permanent Link: Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
<li><a href='http://mitcho.com/blog/projects/foxkeh-demos-ubiquity-parser-the-next-generation/' rel='bookmark' title='Permanent Link: Foxkeh demos Ubiquity Parser: The Next Generation'>Foxkeh demos Ubiquity Parser: The Next Generation</a></li>
<li><a href='http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/' rel='bookmark' title='Permanent Link: A Demonstration of Ubiquity Parser 2'>A Demonstration of Ubiquity Parser 2</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>今夜リリースされる <a href="http://ubiquity.mozilla.com">Ubiquity</a> の最新版、0.5 に備えて日本語で Ubiquity のスクリーンキャストを作ってみました。 Ubiquity 0.5 は特に多言語化を重視したリリースで、 Ubiquity 内蔵のコマンドが日本語とデンマーク語で使えるようになっています。是非<a href="http://ubiquity.mozilla.com">インストール</a>してみてください！</p>

<p><b>追伸：</b> ７月３日現在、 Ubiquity 0.5 の<a href="http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/9073295d0281f768">リリースを遅らせる方向</a>になったので、残念ながら今日はリリースされません。是非リリース後インストールしてみてください。</p>

<p><object width="649" height="365"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5420966&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5420966&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="649" height="365"></embed></object><br /><a href="http://vimeo.com/5420966">Ubiquity 0.5 日本語紹介ビデオ</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>As Ubiquity 0.5 will be released soon (Thursday morning in Mountain View), I decided it was a good time to put together a screencast in Japanese demoing the use of the new Japanese parser and commands.</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Permanent Link: Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
<li><a href='http://mitcho.com/blog/projects/foxkeh-demos-ubiquity-parser-the-next-generation/' rel='bookmark' title='Permanent Link: Foxkeh demos Ubiquity Parser: The Next Generation'>Foxkeh demos Ubiquity Parser: The Next Generation</a></li>
<li><a href='http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/' rel='bookmark' title='Permanent Link: A Demonstration of Ubiquity Parser 2'>A Demonstration of Ubiquity Parser 2</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/ubiquity-0-5-%e6%97%a5%e6%9c%ac%e8%aa%9e%e7%b4%b9%e4%bb%8b%e3%83%93%e3%83%87%e3%82%aa/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
