readabilite: add some function descriptions

master
pictuga 2018-10-25 01:12:42 +02:00
parent 8d7e1811fd
commit 5d93d68f62
1 changed files with 4 additions and 0 deletions

View File

@ -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)