Skip to content
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

Merged
merged 7 commits into from
Jan 10, 2017
Merged

Refactor rule attributes #126

merged 7 commits into from
Jan 10, 2017

Conversation

zorkow
Copy link
Member

@zorkow zorkow commented Jan 10, 2017

Refactors speech rules to explicitly handle attributes and grammar annotations.

* Defines grammar attribute for a component of a speech rule.
* @typedef {!Object.<string, string|boolean>}
*/
sre.SpeechRule.Grammar;
Copy link
Member Author

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;
Copy link
Member Author

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('=');
Copy link
Member Author

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.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar type!

@zorkow zorkow merged commit 5a0ff60 into moss_project Jan 10, 2017
@zorkow zorkow deleted the refactor_rule_attributes branch January 10, 2017 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant