From 5d93d68f625b66b55bc41d544780fb2bffc21fd4 Mon Sep 17 00:00:00 2001 From: pictuga Date: Thu, 25 Oct 2018 01:12:42 +0200 Subject: [PATCH] readabilite: add some function descriptions --- morss/readabilite.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/morss/readabilite.py b/morss/readabilite.py index 8484749..115e4c9 100644 --- a/morss/readabilite.py +++ b/morss/readabilite.py @@ -149,6 +149,8 @@ def spread_score(node, score, grades): def write_score_all(root, grades): + " Useful for debugging " + for node in root.iter(): node.attrib['score'] = str(int(grades.get(node, 0))) @@ -281,6 +283,8 @@ def get_best_node(grades): def get_article(data, url=None, encoding=None): + " Input a raw html string, returns a raw html string of the article " + html = parse(data, encoding) scores = score_all(html)