// Exit recognition if any of the transcribed phrases could be// one of our keywords.ifany(alt.confidence > .5 and
(alt.transcript.strip()in("exit", "quit"))
for result in resp.results
for alt in result.alternatives):
print("Exiting..")
After Change
// Exit recognition if any of the transcribed phrases could be// one of our keywords.ifany(re.search(r"\b(exit|quit)\b", alt.transcript)for result in resp.results
for alt in result.alternatives):
print("Exiting..")
return