Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created February 12, 2017 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/ead4990d4c497494fdf9d0f4cb5ed540 to your computer and use it in GitHub Desktop.
Save flushpot1125/ead4990d4c497494fdf9d0f4cb5ed540 to your computer and use it in GitHub Desktop.
delegate void KeywordAction(PhraseRecognizedEventArgs args);
Dictionary<string, KeywordAction> keywordCollection;
void Start()
{
keywordCollection = new Dictionary<string, KeywordAction>();
// Add keyword to start manipulation.
// keywordCollection.Add("Move Astronaut", MoveAstronautCommand);
keywordCollection.Add("Move", MoveAstronautCommand);
/* TODO: DEVELOPER CODING EXERCISE 5.a */
// 5.a: Add keyword Expand Model to call the ExpandModelCommand function.
keywordCollection.Add("Expand Model", ExpandModelCommand);
// 5.a: Add keyword Reset Model to call the ResetModelCommand function.
keywordCollection.Add("Reset Model", ResetModelCommand);
// Initialize KeywordRecognizer with the previously added keywords.
keywordRecognizer = new KeywordRecognizer(keywordCollection.Keys.ToArray());
keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
keywordRecognizer.Start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment