NSSpeechRecognizer and complex commands/grammars?
NSSpeechRecognizer and complex commands/grammars?
- Subject: NSSpeechRecognizer and complex commands/grammars?
- From: Alex Hall <email@hidden>
- Date: Thu, 06 Feb 2014 18:48:32 -0500
Hello everyone,
In looking at the class reference for the NSSpeechRecognizer, you are told that:
Through an NSSpeechRecognizer instance, Cocoa applications can use the speech recognition engine built into OS X to recognize spoken commands. With speech recognition, users can accomplish complex, multi-step tasks with one spoken command—for example, “schedule a meeting with Adam and John tomorrow at ten o’clock.”
However, nowhere else is it explained how such a complex command could be recognized. In fact, it is specified that all commands are to be NSString objects. There is no way to define a generalized grammar, include wildcards, or anything else that would make the "schedule a meeting" example doable. Yes, you could define a string for every hour and minute of the day, with every combination of names you can think of, but that quickly becomes ridiculous. Unless I missed it, the lower-level Carbon APIs for speech recognition are similarly limited.
My aim is to build an app that combines some features of Sir (scheduling reminders or making email messages) with features of apps like Dragon ("move [up | down | left | right] [number] [characters | words | lines]", "select line", "select [word]", and so on). Clearly, simple commands encoded as strings won't cut it. The NSSpeechRecognizer docs indicate that what I want is possible, but then never explain how. Yes, some of it is doable by recognizing smaller commands and stringing them together and/or switching command sets on the fly based on previous commands, but some is not. Commands where an arbitrary word, such as a name, number, or word in a document, are used will not work.
As I said, I could fake it for some commands, mostly where numbers are involved, by generating many possible strings in a loop. Is there a better, more robust way to do this that will accept input of arbitrary data as part of a defined command? I'm not looking for any sort of AI or learning process, but the pre-defined commands I will implement do need to be less strict than what it appears I am stuck using. Any suggestions would be great. Thanks.
--
Have a great day,
Alex
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden