Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def handle_utterance_str(text) :
if text[0] != "'" and text[0] != '"' :
text = f'"{text}"'
text = text.replace('"', '\"')
text = text.replace("'", '\"')
return "handle_utterance(1,{},Output)".format(text)
def escape_and_call_prolexa(text) :
libPrefix = "prolexa:"
return pl.query(libPrefix + handle_utterance_str(text))
#out = pl.query("prolexa:handle_utterance(1,\"Peter is mortal\",Output)", catcherrors=True)
#
out = escape_and_call_prolexa('"Peter is mortal"')
list(out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.