Open aawadall opened 6 years ago
# TODO:
if ':' in inp:
sentence = inp.split(':')
elif ';' in inp:
sentence = inp.split(';')
else:
sentence = inp.split(' ')
verb = sentence[0]
noun = sentence[1::]
# 1: split string into a verb and rest of string
would this work?
nvm you already have that section built
# 3: slice input string into tokens; keywords and literals
# literals identified by double quotes, single quotes or square brackets surrounding them
if '"' in op_code:
literal = op_code.split('"',2)
elif "'" in op_code:
literal = op_code.split("'",2)
elif "[]" in op_code:
literal = op_code.split('[').split(']')
Yes, this portion is covered already what is pending is defining the syntax rules, and hopefully offloading it into the configuration file, such that a syntax rule is defined as a REGEX, followed by a pointer to the method/api call to invoke
A new module is required to parse user input as text and map it into into API calls