Created
May 22, 2020 10:45
-
-
Save g-leech/2bed3af50a7e692a84e8e434d2441d21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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