public class TrecForwardIndex extends Object implements DocumentForwardIndex<TrecDocument>
| Constructor and Description |
|---|
TrecForwardIndex() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
TrecDocument |
getDocument(int docno)
Fetches the document for a given docno.
|
TrecDocument |
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(org.apache.hadoop.fs.Path index,
org.apache.hadoop.fs.Path mapping,
org.apache.hadoop.fs.FileSystem fs)
Loads the index.
|
static void |
main(String[] args)
Simple program the provides access to the document contents.
|
public int getDocno(String docid)
DocumentForwardIndexgetDocno in interface DocumentForwardIndex<TrecDocument>public String getDocid(int docno)
DocumentForwardIndexgetDocid in interface DocumentForwardIndex<TrecDocument>public int getLastDocno()
DocumentForwardIndexgetLastDocno in interface DocumentForwardIndex<TrecDocument>public int getFirstDocno()
DocumentForwardIndexgetFirstDocno in interface DocumentForwardIndex<TrecDocument>public String getCollectionPath()
DocumentForwardIndexgetCollectionPath in interface DocumentForwardIndex<TrecDocument>public TrecDocument getDocument(String docid)
DocumentForwardIndexgetDocument in interface DocumentForwardIndex<TrecDocument>public TrecDocument getDocument(int docno)
DocumentForwardIndexgetDocument in interface DocumentForwardIndex<TrecDocument>public void loadIndex(org.apache.hadoop.fs.Path index,
org.apache.hadoop.fs.Path mapping,
org.apache.hadoop.fs.FileSystem fs)
throws IOException
DocumentForwardIndexloadIndex in interface DocumentForwardIndex<TrecDocument>index - path of the index datamapping - path of the docno/docid mapping datafs - reference to the FileSystemIOExceptionpublic static void main(String[] args) throws IOException
IOExceptionCopyright © 2015. All rights reserved.