edu.umd.cloud9.collection.wikipedia
Class WikipediaForwardIndex

java.lang.Object
  extended by edu.umd.cloud9.collection.wikipedia.WikipediaForwardIndex
All Implemented Interfaces:
DocumentForwardIndex<WikipediaPage>

public class WikipediaForwardIndex
extends Object
implements DocumentForwardIndex<WikipediaPage>

Forward index for Wikipedia collections.

Author:
Jimmy Lin

Constructor Summary
WikipediaForwardIndex()
           
WikipediaForwardIndex(Configuration conf)
           
 
Method Summary
 String getCollectionPath()
          Returns the base path of the collection.
 String getDocid(int docno)
          Returns the docid, given the docno
 int getDocno(String docid)
          Returns the docno, given the docid
 WikipediaPage getDocument(int docno)
          Fetches the document for a given docno.
 WikipediaPage getDocument(String docid)
          Fetches the document for a given docid.
 int getFirstDocno()
          Returns the first docno in the collection.
 int getLastDocno()
          Returns the last docno in the collection.
 void loadIndex(String indexFile, String mappingDataFile)
          Loads the index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikipediaForwardIndex

public WikipediaForwardIndex()

WikipediaForwardIndex

public WikipediaForwardIndex(Configuration conf)
Method Detail

loadIndex

public void loadIndex(String indexFile,
                      String mappingDataFile)
               throws IOException
Description copied from interface: DocumentForwardIndex
Loads the index.

Specified by:
loadIndex in interface DocumentForwardIndex<WikipediaPage>
Throws:
IOException

getCollectionPath

public String getCollectionPath()
Description copied from interface: DocumentForwardIndex
Returns the base path of the collection.

Specified by:
getCollectionPath in interface DocumentForwardIndex<WikipediaPage>

getDocument

public WikipediaPage getDocument(int docno)
Description copied from interface: DocumentForwardIndex
Fetches the document for a given docno.

Specified by:
getDocument in interface DocumentForwardIndex<WikipediaPage>

getDocument

public WikipediaPage getDocument(String docid)
Description copied from interface: DocumentForwardIndex
Fetches the document for a given docid.

Specified by:
getDocument in interface DocumentForwardIndex<WikipediaPage>

getDocno

public int getDocno(String docid)
Description copied from interface: DocumentForwardIndex
Returns the docno, given the docid

Specified by:
getDocno in interface DocumentForwardIndex<WikipediaPage>

getDocid

public String getDocid(int docno)
Description copied from interface: DocumentForwardIndex
Returns the docid, given the docno

Specified by:
getDocid in interface DocumentForwardIndex<WikipediaPage>

getFirstDocno

public int getFirstDocno()
Description copied from interface: DocumentForwardIndex
Returns the first docno in the collection.

Specified by:
getFirstDocno in interface DocumentForwardIndex<WikipediaPage>

getLastDocno

public int getLastDocno()
Description copied from interface: DocumentForwardIndex
Returns the last docno in the collection.

Specified by:
getLastDocno in interface DocumentForwardIndex<WikipediaPage>