Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixed scraper
orbiter72482b1426fb
diff --git a/source/de/anomic/htmlFilter/htmlFilterAbstractScraper.java b/source/de/anomic/htmlFilter/htmlFilterAbstractScraper.javaindex f90f188db..efb3fcfb6 100644--- a/source/de/anomic/htmlFilter/htmlFilterAbstractScraper.java+++ b/source/de/anomic/htmlFilter/htmlFilterAbstractScraper.java@@ -304,7 +304,7 @@ public abstract class htmlFilterAbstractScraper implements htmlFilterScraper {}//the 'missing' method that shall be implemented:- public abstract void scrapeText(char[] text, boolean insideTag);+ public abstract void scrapeText(char[] text, String insideTag);// the other methods must take into account to construct the return value correctlypublic abstract void scrapeTag0(String tagname, Properties tagopts);diff --git a/source/de/anomic/htmlFilter/htmlFilterContentScraper.java b/source/de/anomic/htmlFilter/htmlFilterContentScraper.javaindex 53a5d6406..6196fabc0 100644--- a/source/de/anomic/htmlFilter/htmlFilterContentScraper.java+++ b/source/de/anomic/htmlFilter/htmlFilterContentScraper.java@@ -119,10 +119,10 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implemenreturn (c == '.') || (c == '!') || (c == '?');}- public void scrapeText(char[] newtext, boolean insideTag) {+ public void scrapeText(char[] newtext, String insideTag) {// System.out.println("SCRAPE: " + new String(newtext));serverCharBuffer b = super.stripAll(new serverCharBuffer(newtext, newtext.length + 1)).trim();- if (insideTag) {+ if ((insideTag != null) && (!(insideTag.equals("a")))) {// texts inside tags sometimes have no punctuation at the line end// this is bad for the text sematics, because it is not possible for the// condenser to distinguish headlines from text beginnings.diff --git a/source/de/anomic/htmlFilter/htmlFilterScraper.java b/source/de/anomic/htmlFilter/htmlFilterScraper.javaindex 8c506de70..cc830ad91 100644--- a/source/de/anomic/htmlFilter/htmlFilterScraper.java+++ b/source/de/anomic/htmlFilter/htmlFilterScraper.java@@ -48,7 +48,7 @@ public interface htmlFilterScraper {public boolean isTag1(String tag);- public void scrapeText(char[] text, boolean insideTag);+ public void scrapeText(char[] text, String insideTag);public void scrapeTag0(String tagname, Properties tagopts);diff --git a/source/de/anomic/htmlFilter/htmlFilterWriter.java b/source/de/anomic/htmlFilter/htmlFilterWriter.javaindex 3045643c3..f3c0d05da 100644--- a/source/de/anomic/htmlFilter/htmlFilterWriter.java+++ b/source/de/anomic/htmlFilter/htmlFilterWriter.java@@ -186,7 +186,7 @@ public final class htmlFilterWriter extends Writer {// we are not collection tag textif (tag == null) {// and this is not a tag opener/closer- if (scraper != null) scraper.scrapeText(content, false);+ if (scraper != null) scraper.scrapeText(content, null);if (transformer != null) return transformer.transformText(content);return content;}@@ -221,7 +221,7 @@ public final class htmlFilterWriter extends Writer {// we are collection tag text for the tag 'filterTag'if (tag == null) {// go on collecting content- if (scraper != null) scraper.scrapeText(content, true);+ if (scraper != null) scraper.scrapeText(content, filterTag);if (transformer != null) {filterCont.append(transformer.transformText(content));} else {