canmove, Confirmed users, Bureaucrats and Sysops emeriti
960
edits
(→Language-specific parser plugins: Change to wikilink) |
(More wikilinks) |
||
Line 45: | Line 45: | ||
The next step in the parsing process is to take the input verb (which we found in the last step) and compare it to the name of each command to figure out which ones are potential matches. (Note: this part is actually '''not''' language-specific, but it's done in the language-specific plugin for reasons of keeping the code relatively simple. In the future we may factor it out to the main parser.) | The next step in the parsing process is to take the input verb (which we found in the last step) and compare it to the name of each command to figure out which ones are potential matches. (Note: this part is actually '''not''' language-specific, but it's done in the language-specific plugin for reasons of keeping the code relatively simple. In the future we may factor it out to the main parser.) | ||
Each verb is scored against the input string, using the metric described in [ | Each verb is scored against the input string, using the metric described in [[Labs/Ubiquity/Parser_Documentation#Scoring_the_Quality_of_the_Verb_Match|Scoring the Quality of the Verb Match]]. These scores will be used later to sort the suggestions in order from best to worst, but for now we only care whether a verb gets a score greater than zero. Verbs that get a match quality score of 0 are discarded at this point, while anything with a positive number -- meaning it matches at all, no matter how tenuously -- continues to the next step. | ||
== Mid-Stage Parsing: Assigning the Arguments == | == Mid-Stage Parsing: Assigning the Arguments == | ||
Line 203: | Line 203: | ||
=== Getting suggestions from NounTypes === | === Getting suggestions from NounTypes === | ||
Find out more about [ | Find out more about [[Labs/Ubiquity/Ubiquity_0.1_Nountypes_Reference|the built-in noun-types]]. | ||
See also [ | See also [[Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial#Switching:_Writing_your_own_Noun-Types|Writing your own Noun-Types]] on the command author tutorial page. | ||
Noun-types are also language-specific. The built-in ones are defined in ubiquity/feed-parts/header/<language code>/nountypes.js -- e.g. ubiquity/feed-parts/header/en/nountypes.js | Noun-types are also language-specific. The built-in ones are defined in ubiquity/feed-parts/header/<language code>/nountypes.js -- e.g. ubiquity/feed-parts/header/en/nountypes.js |