I wonder if it's possible to incorporate some sort of fuzzy matching to the MySQL query, so if the search is off by a single character it would still yield a match. Maybe run an exact search and if no results come up then run a fuzzy search. I guess we are going to have to start building contact databases with a field for alternate pronunciations.
The "right" (TM)
way to do that, and what is actually used in cases like this in speech recognition applications is the use of grammar rules. By defining a grammar for your application you can specify words and patterns of words to be recognised in a certain way. For instance we can have Joshua or Josh always recognised as Joshua, Mark and Marky recognised the same way, we can have optionally use of surnames, we can Have Delta air lines always regognised as "delta air lines" and American airlines as "american airlines" and so on. In the case of 'Directory Assistance' a well defined grammar by the user can make the database lookup a lot more reliable.
There is already a
defined format for grammar syntax by w3c.
Asterisk has an internal
API for speech recognition that supports grammar rules.
Google's STT engine supports grammars but as far as i know it supports only some predefined grammars which cannot be edited by the user. (This might not be true, I ll have to search a bit deeper in their code but the only thing i have seen so far is the use of predefined grammars.)
The speech recognition AGI script for asterisk has no support of grammars yet. It is high on my TODO list but its not yet implemented. My first thought was to use the internal asterisk speech recognition API but that doesn't seem very practical, especially for an AGI script. What I'm actually planning to do is to add support for
Augmented Backus-Naur Form (ABNF) grammars without the use of any 3rd party APIs. This will take some time and it all depends on the amount of free time I ll have the next few weeks.