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

fix chunking issue #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix chunking issue #3

wants to merge 2 commits into from

Conversation

npow
Copy link

@npow npow commented Nov 5, 2015

Fix for #2. @ryan-lowe: I did some refactoring and moved process_line into utils.py, but I don't have time to check that I haven't broken anything.

if hasattr(c, 'label'):
if c.label() in nodelist:
return "__%s__" % c.label()
word = c[0]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use c.leaves() to flatten the words in a tree. Maybe its better?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a tree and it has a label property, we can simply return the label. I've added a check in cea46ad to handle the case if the tree doesn't have a label.

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