1 2 3 4 package net.nutch.clustering.carrot2; 5 6 import net.nutch.searcher.HitDetails; 7 8 import com.dawidweiss.carrot.core.local.clustering.RawDocument; 9 import com.dawidweiss.carrot.core.local.clustering.RawDocumentBase; 10 11 18 public class NutchDocument extends RawDocumentBase { 19 20 private final Integer id; 21 22 26 public NutchDocument(int id, HitDetails details, String summary) { 27 super.setProperty(RawDocument.PROPERTY_URL, details.getValue("url")); 28 super.setProperty(RawDocument.PROPERTY_SNIPPET, summary); 29 30 String title = details.getValue("title"); 31 if (title != null && !"".equals(title)) { 32 super.setProperty(RawDocument.PROPERTY_TITLE, title); 33 } 34 35 this.id = new Integer (id); 36 } 37 38 41 public Object getId() { 42 return id; 43 } 44 } 45 | Popular Tags |