Skip to content

Instantly share code, notes, and snippets.

Created May 22, 2020 10:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment