Labs/Ubiquity/Parser 2/Localization Tutorial: Difference between revisions

Line 63: Line 63:


== Defining your roles ==
== Defining your roles ==
  en.roles = [
    {role: 'goal', delimiter: 'to'},
    {role: 'source', delimiter: 'from'},
    {role: 'position', delimiter: 'at'},
    {role: 'position', delimiter: 'on'},
    {role: 'alias', delimiter: 'as'},
    {role: 'instrument', delimiter: 'using'},
    {role: 'instrument', delimiter: 'with'}
  ];
The second required property is the inventory of semantic roles and their corresponding delimiters. Each entry has a <code>role</code> from the [[https://wiki.mozilla.org/Labs/Ubiquity/Parser_2/Semantic_Roles|inventory of semantic roles]] and a corresponding delimiter. Note that this mapping can be many-to-many, i.e., each role can have multiple possible delimiters and different roles can have shared delimiters. Try to make sure to cover all of the roles in the [[Labs/Ubiquity/Parser_2/Semantic_Roles|inventory of semantic roles]].
=== For more info: ===
* [http://mitcho.com/blog/projects/writing-commands-with-semantic-roles/ Writing commands with semantic roles], the original proposal
* [[Labs/Ubiquity/Parser_2/Semantic_Roles|Semantic Roles in Parser 2]]
* Wikipedia entry on [http://en.wikipedia.org/wiki/Thematic_relation themantic relations]
== Entering your anaphora ("magic words") ==
308

edits