Labs/Ubiquity/Parser 2/Localization Tutorial: Difference between revisions
(Created page with ' =TODO= Do we want to move mitcho's post into the wiki once the API is stable? [http://mitcho.com/blog/how-to/adding-your-language-to-ubiquity-parser-2/ Adding your language t...') |
No edit summary |
||
Line 1: | Line 1: | ||
<small>If you are interested in command localization, please read the wiki pages on [[Ubiquity_0.5_Command_Localization_Tutorial|localizing commands]] and [[Ubiquity_0.5_Making_Commands_Localizable|making commands localizable]]. This entry is for adding your language to Parser 2, so you can use Ubiquity with the grammar of your language.</small> | |||
== Introduction == | |||
Ubiquity's Parser 2 was written from the ground up with one of its greatest priorities being internationalization... not just making commands localizable, but actually making it so Parser 2 can be easily taught the grammars of other languages. Key to this undertaking is an idea from the [http://en.wikipedia.org/wiki/Principles_and_parameters Principles and Parameters] school of linguistics, that all languages' grammars are made up of the following: (from wikipedia) | |||
* A finite set of fundamental '''principles''' that are common to all languages; e.g., that a sentence must always have a [[subject (grammar)|subject]], even if it is not overtly pronounced. | |||
* A finite set of '''parameters''' that determine syntactic variability amongst languages; e.g., a binary parameter that determines whether or not the subject of a sentence must be overtly pronounced. | |||
[http:// | Following this idea, we built a flexible universal parser, Parser 2, and pair it with a (often very small) set of individual language settings. | ||
The result of this architecture is that it takes very little code to teach Parser 2 a new language. With a little bit of JavaScript and knowledge of and interest in your own language, you’ll be able to get at least rudimentary Ubiquity functionality in your language. Follow along in this step by step guide and please [http://ubiquity.mozilla.com/trac/ticket/662 submit your (even incomplete) language files]. |
Revision as of 07:16, 22 June 2009
If you are interested in command localization, please read the wiki pages on localizing commands and making commands localizable. This entry is for adding your language to Parser 2, so you can use Ubiquity with the grammar of your language.
Introduction
Ubiquity's Parser 2 was written from the ground up with one of its greatest priorities being internationalization... not just making commands localizable, but actually making it so Parser 2 can be easily taught the grammars of other languages. Key to this undertaking is an idea from the Principles and Parameters school of linguistics, that all languages' grammars are made up of the following: (from wikipedia)
- A finite set of fundamental principles that are common to all languages; e.g., that a sentence must always have a subject, even if it is not overtly pronounced.
- A finite set of parameters that determine syntactic variability amongst languages; e.g., a binary parameter that determines whether or not the subject of a sentence must be overtly pronounced.
Following this idea, we built a flexible universal parser, Parser 2, and pair it with a (often very small) set of individual language settings.
The result of this architecture is that it takes very little code to teach Parser 2 a new language. With a little bit of JavaScript and knowledge of and interest in your own language, you’ll be able to get at least rudimentary Ubiquity functionality in your language. Follow along in this step by step guide and please submit your (even incomplete) language files.