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

Unified Diff: java/org/chromium/distiller/webdocument/ElementAction.java

Issue 2596283004: Use stricter comment-detecting heuristics (Closed)
Patch Set: Created 4 years 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 | javatests/org/chromium/distiller/webdocument/ElementActionTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: java/org/chromium/distiller/webdocument/ElementAction.java
diff --git a/java/org/chromium/distiller/webdocument/ElementAction.java b/java/org/chromium/distiller/webdocument/ElementAction.java
index 0614179790a180d3b02424be9b90a00ab3499d75..589ed5c79bdc48e8613d5b07c70ce5e34a04f537 100644
--- a/java/org/chromium/distiller/webdocument/ElementAction.java
+++ b/java/org/chromium/distiller/webdocument/ElementAction.java
@@ -20,7 +20,7 @@ public class ElementAction {
public JsArrayString labels = JavaScriptObject.createArray().<JsArrayString>cast();
private static final RegExp REG_COMMENT = RegExp.compile("\\bcomments?\\b");
- private static final int MAX_CLASS_COUNT = 5;
+ private static final int MAX_CLASS_COUNT = 2;
mdjones 2017/01/04 14:29:21 nit: the way this is used seems to be as a minimum
wychen 2017/01/04 14:37:51 What do you mean? This constant is the largest all
mdjones 2017/01/04 15:14:33 Ah, I was looking at it from: "if class count does
public static ElementAction getForElement(Element element) {
Style style = DomUtil.getComputedStyle(element);
@@ -62,7 +62,7 @@ public class ElementAction {
break;
}
- if (!"HTML".equals(tagName) && !"BODY".equals(tagName)) {
+ if (!"HTML".equals(tagName) && !"BODY".equals(tagName) && !"ARTICLE".equals(tagName)) {
String className = element.getAttribute("class");
int classCount = DomUtil.getClassList(element).length();
String id = element.getAttribute("id");
« no previous file with comments | « no previous file | javatests/org/chromium/distiller/webdocument/ElementActionTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698