Skip to content

Conversation

@mercuree
Copy link
Contributor

@mercuree mercuree commented Feb 5, 2017

add_siblings() adds previous node siblings (which were also scored as good elements) before top_node.
Usually, such nodes don't exist or there is only one node, which is previous sibling of top_node and has good score. So this code worked well in many cases. But if we have more than one such node, the bug appears because node elements are inserted always at first position in a list top_node.insert(0, p), so first element becomes last and vise versa.
It was hard to catch this bug, 70 web pages from different domains just passed all my tests with this fix and without it.
I will add tests later,

@mercuree mercuree closed this Feb 6, 2017
@mercuree mercuree reopened this Feb 7, 2017
@mercuree
Copy link
Contributor Author

mercuree commented Feb 7, 2017

Added tests

Copy link
Collaborator

@yprez yprez left a comment

Choose a reason for hiding this comment

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

Looks good to me

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