gofmt -s -w .
This commit is contained in:
parent
614dcc8975
commit
2df2f41516
11 changed files with 30 additions and 34 deletions
|
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue