1,007
edits
No edit summary |
|||
| Line 22: | Line 22: | ||
=== Looking for a Verb Match === | === Looking for a Verb Match === | ||
The parser maintains a list of every command that's installed in Ubiquity, and the next step in the parsing process is to take the input verb and compare it to the name of each command to figure out which ones are potential matches, rank them by match quality, and eliminate the rest. | |||
When attempting to match an input verb to a command name, the parser tries the following types of matches: | |||
# Direct match of input verb to the beginning of the command name, e.g. matching "trans" to "translate". This is considered the best type of match. | |||
# Match in the middle or end of the command name, e.g. matching "ans" to "translate". This type of match is considered not as good: that is, if you type "ans" then the parser assumes you are more likely to mean "answer" than "translate". But a mid-word match is still better than nothing. | |||
# Match to one of the command's synonyms. A command can define any number of synonyms. For example, "tweet" is a synonym for "twitter", so if the input is "twee" then "twitter" will go in this category. A match to a synonym is not as good as a match to the primary command name. | |||
# Match in the middle or end of a synonym. For example, matching "eet" to "twitter" because it matches the end of "tweet". This type of match is unlikely to be what the user is looking for, and so we try only to suggest it if there are no better matches. | |||
=== If there is no verb match: Noun-First Suggestions === | === If there is no verb match: Noun-First Suggestions === | ||
edits