bash: find the closest match?
I'm writing an IVR for asterisk with voice recognition (so far so good).
I would like to enable my the caller to "speak the name of the person that he wants to talk, convert voice to text, and pass the result to a bash script wich would get the text, compare with names on the list, get the most similar and return the correct name and extension to asterisk." (atm this is working fine if voice to text gets the correct name)
The problem is that is common for voice to text to misunderstand some letters or even some parts of the name
Can someone give me an idea about a good way in bash for comparing a variable against a list of words/strings (in a text file) and get the "closest match"? (or even the the best matches?)
Any suggestions would be greatly appreciated!