readabilite: explain the use of .tail

master
pictuga 2017-02-25 18:14:13 -10:00
parent a5aec8c7a6
commit 58d9f65735
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ def score_node(node):
score += len(regex_good.findall(class_id) * 4) score += len(regex_good.findall(class_id) * 4)
score -= len(regex_bad.findall(class_id) * 3) score -= len(regex_bad.findall(class_id) * 3)
score += count_words(''.join([node.text or ''] + [x.tail or '' for x in node])) / 10. score += count_words(''.join([node.text or ''] + [x.tail or '' for x in node])) / 10. # the .tail part is to include *everything* in that node
return score return score