0.5 Conversion: Defining argument prepositions

5 views
Skip to first unread message

garyhodgson

unread,
Jun 28, 2009, 10:29:24 AM6/28/09
to ubiquity-firefox
Hi guys,

In parser 2 is it possible to define the names of prepositions that
are used in argument roles?

E.g. Previously there was a modifier called "in", and this meant the
user could enter "view-tasks in list". In Parser2 world the best role
I have found is "source" and this results in "view-tasks from list".
Discussions about which preposition is more suitable aside, I would
prefer the user experience not to be forced to change because of an
API change. Therefore is there a way of customizing the preposition
used?

Would be great if there could be some feedback before the 0.5 release
to the general public.

Thanks in advance,
Gary

"mitcho (Michael 芳貴 Erlewine)"

unread,
Jun 28, 2009, 10:46:51 AM6/28/09
to ubiquity...@googlegroups.com
Hi Gary,

I think the role you're looking for is "location", which in English
maps to the delimiters "in" and "at", as well as "near" which wouldn't
be applicable in your situation. The use of semantic roles in
identifying arguments has tremendous advantages for the localization
process which we've begun, as the logic of commands is no longer tied
to a specific language. This also allows for synonymous delimiters as
well, like "to" and "toward" or "using" and "with" acting the same way.

More information on the use of semantic roles and a master list of
semantic roles can be found here:

https://wiki.mozilla.org/Labs/Ubiquity/Parser_2/Semantic_Roles

mitcho
--
mitcho (Michael 芳貴 Erlewine)
mit...@mitcho.com
http://mitcho.com/
linguist, coder, teacher

Gary Hodgson

unread,
Jun 28, 2009, 1:16:38 PM6/28/09
to ubiquity...@googlegroups.com
Thanks for the really quick reply Mitcho!  It's much appreciated!

I changed the argument to use the 'location' role, and now it reads: "view-tasks near list".  As per my original question, how do I go about changing the preposition used to be "in" rather than "near"?  Is it a localising action? Sadly the links "localizing commands" and "making commands localizable" on the Semantic Roles page are yet to be written.

Thanks again for the help!

Heather

unread,
Jun 28, 2009, 6:37:59 PM6/28/09
to ubiquity-firefox
Gary,

Actually, all the delimiters associated with a semantic role work for
that role. For location, that is "near", "on", and "at". Brandon
*just* added "in" to that list, so "in" should work for the "location"
role as soon as 0.5pre3 gets pushed out.

I'll work on adding to Mitcho's semantic roles documentation to make
this a little clearer.

Heather

Heather

unread,
Jun 28, 2009, 6:43:26 PM6/28/09
to ubiquity-firefox
To clarify: "in" should have been a "location" delimiter, but when I
checked in response to your question, it was not. That issue is now
patched in the source version and will be pushed to the preview
version in the next update.

"mitcho (Michael 芳貴 Erlewine)"

unread,
Jun 28, 2009, 7:38:39 PM6/28/09
to ubiquity...@googlegroups.com
Gary,

My apologies—as Heather and Brandon noticed, the "in" delimiter was
missing from the list of possible delimiters for "location", but
Brandon has added that in. One thing you've noticed, though, was that
the command says "view-tasks near list"... this is due to the fact
that, even though multiple delimiters ("near", "at", etc.) are defined
for that role, only one can be displayed in that display of missing
arguments, so the first one defined is used. In the case of
"location", I believe it is currently "near"... letting commands
choose a custom delimiter label (preposition) to display from one of
the options for that role is a good idea which we could implement in
the future.

As for the "localizing commands" and "making commands localizable"
links, the links were simply wrong, but they are written:

https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Command_Localization_Tutorial
https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Making_Commands_Localizable

mitcho

> Thanks for the really quick reply Mitcho! It's much appreciated!
>
> I changed the argument to use the 'location' role, and now it reads:
> "view-tasks near list". As per my original question, how do I go
> about changing the preposition used to be "in" rather than "near"?
> Is it a localising action? Sadly the links "localizing commands" and
> "making commands localizable" on the Semantic Roles page are yet to
> be written.
>
> Thanks again for the help!
>
>
>
> On Sun, Jun 28, 2009 at 4:46 PM, "mitcho (Michael 芳貴 Erlewine)" <mitcho@mitcho

Jono DiCarlo

unread,
Jun 29, 2009, 2:10:27 PM6/29/09
to ubiquity-firefox
I agree with Gary that in this case, the suggestion ends up looking
very strange -- "view tasks near list"? What? My tasks are *in* the
list, not *near* it!
For the particular case of the 'location' semantic role, which now has
four different prepositions that work in English, why is "near" the
default preposition? Why not "in"?
(I think "near" was only introduced for the Yelp command, anyway,
because it searches for restaurants "near" a location... but there's
nothing wrong with saying "yelp pizza in chicago", is there?)

For the more general case... could a command argument provide metadata
telling which preposition should be used for the suggestion in the
case where there are multiple synonymous prepositions? e.g. {role:
"location", defaultFlag: "near"} for one command, vs. {role:
"location", defaultFlag: "in"} for another command. Completely
cosmetic, but could make the command significantly easier to learn if
it results in default suggestions that read more naturally. It's
language-specific, but could simply be ignored in languages where it
doesn't apply...

Or maybe the defaultFlag should be an attribute of the nountype?
(Something that we still have to figure out how to localize, anyway).
What do you think? Should we take this to ubiquity-
i1...@googlegroups.com?

--Jono

Christian Sonne

unread,
Jun 29, 2009, 2:45:28 PM6/29/09
to ubiquity...@googlegroups.com

Was just about to yell at you for making it language specific, until I got to the last part of your message :-P

Would it be possible to enforce that the default role must always be the first defined for a given role?

If localizers (of the parsers) know this, it will be simple to localize this feature automatically, by simply placing the most used magic word first for any given role...

It might not be flexible enough, though.

-- cers / Christian Sonne

Blair McBride

unread,
Jun 29, 2009, 6:11:11 PM6/29/09
to ubiquity...@googlegroups.com
That doesn't seem ideal, from a UX perspective. Of course, neither does
listing every delimiter as a separate suggestion.

- Blair

Reply all
Reply to author
Forward
0 new messages