/[Apache-SVN]/lucene/nutch/trunk/src/java/org/apache/nutch/searcher/FetchedSegments.java
ViewVC logotype

Diff of /lucene/nutch/trunk/src/java/org/apache/nutch/searcher/FetchedSegments.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- lucene/nutch/trunk/src/java/org/apache/nutch/searcher/FetchedSegments.java	2006/05/08 21:03:46	405164
+++ lucene/nutch/trunk/src/java/org/apache/nutch/searcher/FetchedSegments.java	2006/05/08 21:04:01	405165
@@ -110,16 +110,12 @@ public class FetchedSegments implements
   }
 
   private HashMap segments = new HashMap();
-  private int sumContext = 5;
-  private int sumLength = 20;
   private Summarizer summarizer;
 
   /** Construct given a directory containing fetcher output. */
   public FetchedSegments(FileSystem fs, String segmentsDir, Configuration conf) throws IOException {
     File[] segmentDirs = fs.listFiles(new File(segmentsDir));
-    this.sumContext = conf.getInt("searcher.summary.context", 5);
-    this.sumLength = conf.getInt("searcher.summary.length", 20);
-    this.summarizer = new Summarizer(conf);
+    this.summarizer = new SummarizerFactory(conf).getSummarizer();
 
     if (segmentDirs != null) {
         for (int i = 0; i < segmentDirs.length; i++) {
@@ -158,9 +154,9 @@ public class FetchedSegments implements
   public String getSummary(HitDetails details, Query query)
     throws IOException {
 
+    if (this.summarizer == null) { return ""; }
     String text = getSegment(details).getParseText(getUrl(details)).getText();
-
-    return this.summarizer.getSummary(text, query, this.sumContext, this.sumLength).toString();
+    return this.summarizer.getSummary(text, query).toString();
   }
     
   private class SummaryThread extends Thread {

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26