Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A file to print parse trees from standard input using NLTK
from nltk.tree import Tree
import sys
# A program to display parse trees (in Penn treebank format) with NLTK
# To install NLTK on ubuntu: sudo apt-get install python-nltk
for line in sys.stdin:
t = Tree.parse(line)

mmhyamin commented Jan 3, 2018

Tree has no attribute 'parse'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment