|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cloud9.collection.trec.TrecDocnoMapping
public class TrecDocnoMapping
Object that maps between TREC docids (String identifiers) to docnos (sequentially-numbered
ints). The main of this class provides a simple program for accessing docno mappings.
Command-line arguments are as follows:
| Constructor Summary | |
|---|---|
TrecDocnoMapping()
Creates a TrecDocnoMapping 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/docno mappings. |
static void |
main(String[] args)
Simple program the provides access to the docno/docid mappings. |
static String[] |
readMappingData(Path p,
FileSystem fs)
Reads a mappings file into memory. |
static void |
writeMappingData(Path input,
Path output,
FileSystem fs)
Creates a mappings file from the contents of a flat text file containing docid to docno mappings. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TrecDocnoMapping()
TrecDocnoMapping object.
| Method Detail |
|---|
public int getDocno(String docid)
DocnoMapping
getDocno in interface DocnoMappingdocid - the docid
public String getDocid(int docno)
DocnoMapping
getDocid in interface DocnoMappingdocno - the docno
public void loadMapping(Path p,
FileSystem fs)
throws IOException
DocnoMapping
loadMapping in interface DocnoMappingp - path to the mappings filefs - reference to the FileSystem
IOException
public static void writeMappingData(Path input,
Path output,
FileSystem fs)
throws IOException
NumberTrecDocuments internally.
input - flat text file containing docid to docno mappingsoutput - output mappings data filefs - FileSystem to write to
IOException
public static String[] readMappingData(Path p,
FileSystem fs)
throws IOException
p - path to the mappings data filefs - appropriate FileSystem
IOException
public static void main(String[] args)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||