Last active
October 12, 2015 05:48
-
-
Save language-engineering/3980058 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# This code assumes you have the *parsed_sents* and *verb_variants* variables | |
# from the previous section. *parsed_sents* is a list of ParsedSentence objects | |
# Print to screen the parsed sentences | |
for sentence in parsed_sents: # *parsed_sents* acquired from the previous section | |
print "-----" # Just a separator | |
print sentence | |
# Each sentence is made up of a list of BasicToken objects | |
# Each token has several attributes: id, form (the actual word), pos, | |
# head, deprel (dependency relation) | |
for token in parsed_sents[0]: # for each token in the first sentence | |
print token.id, token.form, token.pos, token.head, token.deprel | |
# For each sentence, print all of the dependent tokens that are subjects |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment