org.carrot2.core
Interface IDocumentSource

All Superinterfaces:
IProcessingComponent
All Known Implementing Classes:
AmbientDocumentSource, Bing2DocumentSource, Bing2ImageDocumentSource, Bing2NewsDocumentSource, Bing2WebDocumentSource, EToolsDocumentSource, FubDocumentSource, GoogleDesktopDocumentSource, GoogleDocumentSource, IdolDocumentSource, LuceneDocumentSource, MultipageSearchEngine, Odp239DocumentSource, OpenSearchDocumentSource, PubMedDocumentSource, RemoteXmlSimpleSearchEngineBase, SearchEngineBase, SimpleSearchEngine, SolrDocumentSource, XmlDocumentSource

public interface IDocumentSource
extends IProcessingComponent

A marker interface for processing components providing documents for further processing. The general process of implementing IDocumentSources is the following following:

  1. Create a class that implements IDocumentSource and annotate it with Bindable. You may want to extend ProcessingComponentBase to get empty implementations of the IProcessingComponent life cycle methods.
  2. For each input parameter of your document source (e.g. query, number of results, custom filtering etc.) declare a field and annotate it with Attribute and Input. Also, add either Init or Processing annotation depending on the intended scope of the parameter. See IProcessingComponent for information when these fields will be populated with values passed by the caller.
  3. For each output value produced by your document source declare a field and annotate it with Attribute, Output and Processing annotations. For the Documents fetched by your source declare a List< Document > field whose Attribute.key() is AttributeNames.DOCUMENTS
  4. Implement the IProcessingComponent.process() method to fetch the documents (based on the values read from fields annotated with Input which will have already been populated with values passed by the caller) and assign the results to the fields annotated with Output (which Carrot2 core will collect and pass for further processing).


Method Summary
 
Methods inherited from interface org.carrot2.core.IProcessingComponent
afterProcessing, beforeProcessing, dispose, init, process
 



Copyright (c) Dawid Weiss, Stanislaw Osinski