Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Unified Diff: java/org/chromium/distiller/filters/english/TerminatingBlocksFinder.java

Issue 2721133002: Skip some social sharing elements (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | java/org/chromium/distiller/webdocument/DomConverter.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: java/org/chromium/distiller/filters/english/TerminatingBlocksFinder.java
diff --git a/java/org/chromium/distiller/filters/english/TerminatingBlocksFinder.java b/java/org/chromium/distiller/filters/english/TerminatingBlocksFinder.java
index c0e96707161348307b556868119cbb7f6db6d965..27fbfcad1d64bfea02ef56a02bed8542dd128b1f 100644
--- a/java/org/chromium/distiller/filters/english/TerminatingBlocksFinder.java
+++ b/java/org/chromium/distiller/filters/english/TerminatingBlocksFinder.java
@@ -68,10 +68,15 @@ public class TerminatingBlocksFinder implements BoilerpipeFilter {
public static boolean isTerminating(TextBlock tb) {
if (tb.getNumWords() > 14) return false;
String text = StringUtil.jsTrim(tb.getText());
+
if (text.length() >= 8) {
return isTerminatingText(text);
} else if (tb.getLinkDensity() == 1.0) {
return text.equals("Comment");
+ } else if (text.equals("Shares")) {
+ // Skip social and sharing elements.
+ // See crbug.com/692553
+ return true;
}
return false;
}
« no previous file with comments | « no previous file | java/org/chromium/distiller/webdocument/DomConverter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698