-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor rule attributes #126
Conversation
… rules. However, they are not yet in the fromString style.
* Defines grammar attribute for a component of a speech rule. | ||
* @typedef {!Object.<string, string|boolean>} | ||
*/ | ||
sre.SpeechRule.Grammar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propagate that type.
* Defines attributes for a component of a speech rule. | ||
* @typedef {!Object.<string, string>} | ||
*/ | ||
sre.SpeechRule.Attributes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propagate type.
var attributes = {}; | ||
var components = grammar.split(':'); | ||
for (var i = 0, l = components.length; i < l; i++) { | ||
var comp = components[i].split('='); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace trimming!
/** | ||
* Processes the grammar annotations of a rule. | ||
* @param {!Node} node The node to which the rule is applied. | ||
* @param {string} grammar The grammar annotations. | ||
* @param {Object.<string, string|boolean>} grammar The grammar annotations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grammar type!
Refactors speech rules to explicitly handle attributes and grammar annotations.