readabilite: always return common of 2 best nodes

Better results. Less is not more
master
pictuga 2017-07-17 00:10:58 +02:00
parent bfdda18b9c
commit c52b47616d
1 changed files with 2 additions and 7 deletions

View File

@ -207,15 +207,10 @@ def rank_nodes(grades):
def get_best_node(grades): def get_best_node(grades):
top = rank_nodes(grades) top = rank_nodes(grades)
lowest = lowest_common_ancestor(top[0][0], top[1][0], 3)
if top[0][1] < top[1][1] * 1.6:
# we might still want to include the 2nd best node (great for articles split with images)
cmn_ancestor = lowest_common_ancestor(top[0][0], top[1][0], 3) return lowest
return cmn_ancestor
else:
return top[0][0]
def get_article(data, url=None, encoding=None): def get_article(data, url=None, encoding=None):