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

Adding -prompt flag to WebCCG #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shoeffner
Copy link
Contributor

Adding -prompt flag to WebCCG to allow tools like Python's pexpect to parse it more easily.

Specifying the prompt flag wccg -prompt ">>>" GRAMMAR will case wccg to show the prompt expecting input like this:

>>> 

Entering a sentence looks thus:

>>> she sings a song

By default, the old behavior is kept stable (no prompt sign at all).

I use this feature to parse the output using replwrap, to keep a process alive for a longer time (before I used Popen.communicate, which is a one-off command and forced me to create new wccg processes for each parse).

To keep the diff small, I tried to keep the whitespace as it is in the surroundings, but the file mixes tabs and spaces a lot and it seems in lines 85 and 120/121 I somehow missed the conventions a little bit, as I just realized.
If you want, I can update my lines or reindent the file completely.

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

Successfully merging this pull request may close these issues.

None yet

1 participant