From c52b47616d217cc8db19d89687bea9e1389d4989 Mon Sep 17 00:00:00 2001 From: pictuga Date: Mon, 17 Jul 2017 00:10:58 +0200 Subject: [PATCH] readabilite: always return common of 2 best nodes Better results. Less is not more --- morss/readabilite.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/morss/readabilite.py b/morss/readabilite.py index d02d59f..1a03404 100644 --- a/morss/readabilite.py +++ b/morss/readabilite.py @@ -207,15 +207,10 @@ def rank_nodes(grades): def get_best_node(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 cmn_ancestor - - else: - return top[0][0] + return lowest def get_article(data, url=None, encoding=None):