Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser for the Text UI #28

Open
aawadall opened this issue Sep 6, 2017 · 4 comments
Open

Parser for the Text UI #28

aawadall opened this issue Sep 6, 2017 · 4 comments

Comments

@aawadall
Copy link
Owner

aawadall commented Sep 6, 2017

A new module is required to parse user input as text and map it into into API calls

@aawadall aawadall added this to the Features Backlog milestone Sep 6, 2017
@burhania2
Copy link
Contributor

 # 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?

@burhania2
Copy link
Contributor

nvm you already have that section built

@burhania2
Copy link
Contributor


        # 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(']')

@aawadall
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants