Skip to content

Instantly share code, notes, and snippets.

@language-engineering
Last active December 27, 2015 11:39
Show Gist options
  • Save language-engineering/7320665 to your computer and use it in GitHub Desktop.
Save language-engineering/7320665 to your computer and use it in GitHub Desktop.
aspect = "dialogue"
# If you have a ParsedSentence object, you can get all the tokens whose form matches the aspect as shown below.
# So instead of just printing the parsed_sentence as in the previous section, get its aspect tokens and print them.
aspect_tokens = parsed_sentence.get_query_tokens(aspect)
# You could iterate over them and print them for inspection
for aspect_token in aspect_tokens:
print aspect_token
# Remember that each token in a ParsedSentence object is BasicToken object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment