public class CompressedPostingsIO extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
LENGTH_FILE |
| Constructor and Description |
|---|
CompressedPostingsIO() |
| Modifier and Type | Method and Description |
|---|---|
static void |
loadPostings(String path,
FileSystem fs,
CompressedPostings[] postings,
int[] dfs)
Loads an entire collection of postings lists and initializes
the given ranker with this collection.
|
static int |
readNumberOfTerms(String path,
FileSystem fs)
Reads the number of terms from an index
|
static void |
writePostings(String outputPath,
FileSystem fs,
RetrievalEnvironment env,
String spamScoresPath)
Converts the postings of a collection into CompressedPostings and writes
them to disk.
|
public static final String LENGTH_FILE
public static void loadPostings(String path, FileSystem fs, CompressedPostings[] postings, int[] dfs) throws IOException, ClassNotFoundException
path - Path to the root of the postings listfs - File systempostings - Array of CompressedPostings to initializedfs - Array of integers to be initialized (this represents Document Frequencies)IOExceptionClassNotFoundExceptionpublic static int readNumberOfTerms(String path, FileSystem fs) throws IOException, ClassNotFoundException
path - Path to the root of the postings listfs - File systemIOExceptionClassNotFoundExceptionpublic static void writePostings(String outputPath, FileSystem fs, RetrievalEnvironment env, String spamScoresPath) throws IOException
outputPath - Root path to store the output infs - File systemenv - A retrieval environmentspamScoresPath - Path to spam/quality scoresIOException