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

NLTK API tweakage. #23

Merged
merged 2 commits into from
Oct 28, 2014
Merged

NLTK API tweakage. #23

merged 2 commits into from
Oct 28, 2014

Conversation

jimwhite
Copy link

When I tried to use the Python ParsingShell I had errors that seem to be due to an API change in NLTK. nltk.tree.Tree.parse has apparently been removed/replaced by fromstring. There is bracket_parse too but its code says don't use it. Don't know if this is backward compatible but it works for me.

…ng. There is bracket_parse too but it says don't use it.
@jimwhite
Copy link
Author

If you have Docker installed you can see the Python wrapper and GUI shell in action with a minimum of typing. The Docker Hub repo is here and can be launched with:

docker run -it --rm -p 5901:5901 jimwhite/bllip-parser-python

There are a few notes on running it in the description and there is a README.txt within the container (with basically the same info). I plan to make a posting and maybe a little video but figured I'd make a note of this development here in the meantime.

@dmcc
Copy link
Member

dmcc commented Oct 26, 2014

Thanks for the patch! For compatibility, can we have it try fromstring and fallback to trying parse? I'm still using older versions of NLTK in some places.

@jimwhite
Copy link
Author

Sure thing, should have done that to start with but I hardly ever code in Python. Since I'm not set up to test the old code I do that test first as before and the new stuff is in the exception block. The Docker build is updated now too (I tweaked the terminal settings so they're readable).

dmcc added a commit that referenced this pull request Oct 28, 2014
@dmcc dmcc merged commit 3487547 into BLLIP:master Oct 28, 2014
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.

2 participants