I tried converting the dynamic grammar dictionary from the sample app to swift as follow but I get a duplicate key on the second “OneOfTheseWillBeSaidOnce” after “ThisWillBeSaidWithOptionalRepetitions”.
public func Generate() -> NSDictionary {
let grammar: NSDictionary = [
“ThisWillBeSaidOnce”: [“HELLO COMPUTER”, “GREETINGS ROBOT”],
“OneOfTheseWillBeSaidOnce”: [“DO THE FOLLOWING”, “INSTRUCTION”],
“OneOfTheseWillBeSaidOnce”: [“GO”, “MOVE”],
“ThisWIllBeSaidWithOptionalRepetitions”: [
“OneOfTheseWillBeSaidOnce”: [“LEFT”,”RIGHT”,”FORWARD”],
“OneOfTheseWillBeSaidOnce”: [“10″,”20″,”30”]
],
“OneOfTheseWillBeSaidOnce”: [“EXECUTE”, “DO IT”],
“ThisCanBeSaidOnce”: [“THANK YOU”]
]
return grammar
}