@@ -18,9 +18,9 @@ import (
1818const defaultTagsToScore = "section,h2,h3,h4,h5,h6,p,td,pre,div"
1919
2020var (
21- strongCandidates = [... ]string {"popupbody" , "-ad" , "g-plus" }
22- maybeCandidate = [... ]string {"and" , "article" , "body" , "column" , "main" , "shadow" }
23- unlikelyCandidate = [... ]string {"banner" , "breadcrumbs" , "combx" , "comment" , "community" , "cover-wrap" , "disqus" , "extra" , "foot" , "header" , "legends" , "menu" , "modal" , "related" , "remark" , "replies" , "rss" , "shoutbox" , "sidebar" , "skyscraper" , "social" , "sponsor" , "supplemental" , "ad-break" , "agegate" , "pagination" , "pager" , "popup" , "yom-remote" }
21+ strongCandidatesToRemove = [... ]string {"popupbody" , "-ad" , "g-plus" }
22+ maybeCandidateToRemove = [... ]string {"and" , "article" , "body" , "column" , "main" , "shadow" , "content " }
23+ unlikelyCandidateToRemove = [... ]string {"banner" , "breadcrumbs" , "combx" , "comment" , "community" , "cover-wrap" , "disqus" , "extra" , "foot" , "header" , "legends" , "menu" , "modal" , "related" , "remark" , "replies" , "rss" , "shoutbox" , "sidebar" , "skyscraper" , "social" , "sponsor" , "supplemental" , "ad-break" , "agegate" , "pagination" , "pager" , "popup" , "yom-remote" }
2424
2525 positiveKeywords = [... ]string {"article" , "blog" , "body" , "content" , "entry" , "h-entry" , "hentry" , "main" , "page" , "pagination" , "post" , "story" , "text" }
2626 negativeKeywords = [... ]string {"author" , "banner" , "byline" , "com-" , "combx" , "comment" , "contact" , "dateline" , "foot" , "hid" , "masthead" , "media" , "meta" , "modal" , "outbrain" , "promo" , "related" , "scroll" , "share" , "shopping" , "shoutbox" , "sidebar" , "skyscraper" , "sponsor" , "tags" , "tool" , "widget" , "writtenby" }
@@ -185,17 +185,17 @@ func shouldRemoveCandidate(str string) bool {
185185 str = strings .ToLower (str )
186186
187187 // Those candidates have no false-positives, no need to check against `maybeCandidate`
188- for _ , strongCandidate := range strongCandidates {
189- if strings .Contains (str , strongCandidate ) {
188+ for _ , strongCandidateToRemove := range strongCandidatesToRemove {
189+ if strings .Contains (str , strongCandidateToRemove ) {
190190 return true
191191 }
192192 }
193193
194- for _ , unlikelyCandidate := range unlikelyCandidate {
195- if strings .Contains (str , unlikelyCandidate ) {
194+ for _ , unlikelyCandidateToRemove := range unlikelyCandidateToRemove {
195+ if strings .Contains (str , unlikelyCandidateToRemove ) {
196196 // Do we have a false positive?
197- for _ , maybe := range maybeCandidate {
198- if strings .Contains (str , maybe ) {
197+ for _ , maybeCandidateToRemove := range maybeCandidateToRemove {
198+ if strings .Contains (str , maybeCandidateToRemove ) {
199199 return false
200200 }
201201 }
0 commit comments