A file to print parse trees from standard input using NLTK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
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) | |
t.draw() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tree has no attribute 'parse'.