drollins

Forum Replies Created

Viewing 1 post (of 1 total)

  • Author
    Posts
  • in reply to: RuleORama Dynamic Grammar Swift Example #1030625
    drollins
    Participant

    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

    }

Viewing 1 post (of 1 total)