I want to successfully implement an advanced speech recognition system that can know what to do if you speak a phrase of 2 or 3 actions like "GO FORWARD and CHANGE COLOR TO GREEN and then TURN TO THE LEFT". I've implemented a dictionary:
private Dictionary<string, Action[]> actions = new Dictionary<string, Action[]>();
and by now I added some words in it:
actions.Add("up", new Action[] { Up });
actions.Add("down", new Action[] { Down });
actions.Add("left", new Action[] { Left });
actions.Add("right", new Action[] { Right });
actions.Add("green", new Action[] { () => ChangeColor(this.word) });
actions.Add("red", new Action[] { () => ChangeColor(this.word) });
actions.Add("white", new Action[] { () => ChangeColor(this.word) });
actions.Add("blue", new Action[] { () => ChangeColor(this.word) });
actions.Add("yellow", new Action[] { () => ChangeColor(this.word) });
But then I thought...
I want to have advanced speech recognition, so I think (and I hope!) there is a better way than adding lots and lots of combinations of words in this dictionary.
So can you help me? Do you know if there is a better way? Because it would be very unpleasant and boring and it would take a long long time to get in the dictionary what you want. Even for changing color, I can think now at: change color to green, change to green, change your color to green, make green your color, make green your new color, etc.