edu.umd.cloud9.collection.clue
Class ClueWarcDocnoMapping

java.lang.Object
  extended by edu.umd.cloud9.collection.clue.ClueWarcDocnoMapping
All Implemented Interfaces:
DocnoMapping

public class ClueWarcDocnoMapping
extends Object
implements DocnoMapping

Object that maps between WARC-TREC-IDs (String identifiers) to docnos (sequentially-numbered ints). This object provides mappings for the Clue Web English collection; the docnos are numbered from part 1 all the way through part 10.

Note that this class needs the data file docno.mapping, loaded via the loadMapping(Path, FileSystem) method.

Author:
Jimmy Lin

Constructor Summary
ClueWarcDocnoMapping()
          Creates a ClueWarcDocnoMapping object
 
Method Summary
 String getDocid(int docno)
          Returns the docid for a particular docno.
 int getDocno(String docid)
          Returns the docno for a particular docid.
 void loadMapping(Path p, FileSystem fs)
          Loads a mapping file containing the docid to docno mappings.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClueWarcDocnoMapping

public ClueWarcDocnoMapping()
Creates a ClueWarcDocnoMapping object

Method Detail

getDocno

public int getDocno(String docid)
Description copied from interface: DocnoMapping
Returns the docno for a particular docid.

Specified by:
getDocno in interface DocnoMapping
Parameters:
docid - the docid
Returns:
the docno for the docid

getDocid

public String getDocid(int docno)
Description copied from interface: DocnoMapping
Returns the docid for a particular docno.

Specified by:
getDocid in interface DocnoMapping
Parameters:
docno - the docno
Returns:
the docid for the docno

loadMapping

public void loadMapping(Path p,
                        FileSystem fs)
                 throws IOException
Description copied from interface: DocnoMapping
Loads a mapping file containing the docid to docno mappings.

Specified by:
loadMapping in interface DocnoMapping
Parameters:
p - path to the mappings file
fs - appropriate FileSystem
Throws:
IOException