gofmt -s -w .

This commit is contained in:
Nazar Kanaev
2021-04-06 08:43:15 +01:00
parent 614dcc8975
commit 2df2f41516
11 changed files with 30 additions and 34 deletions

View File

@@ -129,10 +129,9 @@ func removeUnlikelyCandidates(root *html.Node) {
continue
}
blacklisted := (
blacklistCandidatesRegexp.MatchString(str) ||
blacklisted := (blacklistCandidatesRegexp.MatchString(str) ||
(unlikelyCandidatesRegexp.MatchString(str) &&
!okMaybeItsACandidateRegexp.MatchString(str)))
!okMaybeItsACandidateRegexp.MatchString(str)))
if blacklisted && node.Parent != nil {
node.Parent.RemoveChild(node)
}
@@ -198,7 +197,7 @@ func getCandidates(root *html.Node) nodeScores {
// Scale the final candidates score based on link density. Good content
// should have a relatively small link density (5% or less) and be mostly
// unaffected by this operation
for node, _ := range scores {
for node := range scores {
scores[node] *= (1 - getLinkDensity(node))
}