readabilite: add some function descriptions
parent
8d7e1811fd
commit
5d93d68f62
|
@ -149,6 +149,8 @@ def spread_score(node, score, grades):
|
||||||
|
|
||||||
|
|
||||||
def write_score_all(root, grades):
|
def write_score_all(root, grades):
|
||||||
|
" Useful for debugging "
|
||||||
|
|
||||||
for node in root.iter():
|
for node in root.iter():
|
||||||
node.attrib['score'] = str(int(grades.get(node, 0)))
|
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):
|
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)
|
html = parse(data, encoding)
|
||||||
scores = score_all(html)
|
scores = score_all(html)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue