aitools::invertedindex::IndexBuilder< Value > Class Template Reference

#include <IndexBuilder.hpp>

List of all members.

Public Member Functions

 IndexBuilder (RecordReader< Value > *reader=new InvertedFileReader< Value >)
 ~IndexBuilder ()
void build (const Configuration &config) throw (std::exception)

Static Public Attributes

static const std::string header_file

Private Types

typedef std::vector< FILE * > FileVector
typedef Configuration::Sorting Sorting
typedef
std::tr1::unordered_map
< std::string,
PostlistBuilder::SharedPointer
BuilderMap

Private Member Functions

void index_random_records_ () throw (std::exception)
void index_sorted_records_ () throw (std::exception)
bfs::path partition_records_ () throw (std::exception)

Static Private Member Functions

static void build_postlists (const bfs::path &path, BuilderMap &builders) throw (std::exception)
static const Configurationcheck_config (const Configuration &config) throw (std::exception)
static void store_header (const Header &header, const bfs::path &path) throw (std::exception)
static void print_header (const Header &header)

Private Attributes

Header header_
Configuration config_
RecordReader< Value > * reader_

Static Private Attributes

static const std::string tmp_dir
static const std::string tmp_file

Detailed Description

template<typename Value>
class aitools::invertedindex::IndexBuilder< Value >

A class to create an inverted index with external storage.

Author:
martin.trenkmann@uni-weimar.de

Created on Jun 22, 2008

Id
IndexBuilder.hpp,v 1.51 2010/10/15 17:44:48 trenkman Exp

Definition at line 28 of file IndexBuilder.hpp.


Member Typedef Documentation

template<typename Value>
typedef std::tr1::unordered_map<std::string, PostlistBuilder::SharedPointer> aitools::invertedindex::IndexBuilder< Value >::BuilderMap [private]

Definition at line 23 of file IndexBuilder.hpp.

template<typename Value>
typedef std::vector<FILE*> aitools::invertedindex::IndexBuilder< Value >::FileVector [private]

Definition at line 20 of file IndexBuilder.hpp.

template<typename Value>
typedef Configuration::Sorting aitools::invertedindex::IndexBuilder< Value >::Sorting [private]

Definition at line 21 of file IndexBuilder.hpp.


Constructor & Destructor Documentation

template<typename Value >
aitools::invertedindex::IndexBuilder< Value >::IndexBuilder ( RecordReader< Value > *  reader = new InvertedFileReader<Value>  )  [inline]

The excplicit constructor.

Definition at line 112 of file IndexBuilder.hpp.

template<typename Value >
aitools::invertedindex::IndexBuilder< Value >::~IndexBuilder (  )  [inline]

The destructor.

Definition at line 119 of file IndexBuilder.hpp.


Member Function Documentation

template<typename Value >
void aitools::invertedindex::IndexBuilder< Value >::build ( const Configuration config  )  throw (std::exception) [inline, virtual]

Implements aitools::invertedindex::Builder.

Definition at line 212 of file IndexBuilder.hpp.

Referenced by aitools::invertedindex::build_ngram_index().

Here is the caller graph for this function:

template<typename Value >
void aitools::invertedindex::IndexBuilder< Value >::build_postlists ( const bfs::path &  path,
BuilderMap builders 
) throw (std::exception) [inline, static, private]

Reads all generic records from the file pointed by bucket and stores their values in postlists that will be created for each key that occurs. All postlists will be inserted into the postlists map.

Parameters:
bucket A file with serialized generic records.
postlists A key-to-postlist map.

Definition at line 129 of file IndexBuilder.hpp.

template<typename Value >
const Configuration & aitools::invertedindex::IndexBuilder< Value >::check_config ( const Configuration config  )  throw (std::exception) [inline, static, private]

Definition at line 151 of file IndexBuilder.hpp.

template<typename Value >
void aitools::invertedindex::IndexBuilder< Value >::index_random_records_ (  )  throw (std::exception) [inline, private]

Definition at line 236 of file IndexBuilder.hpp.

template<typename Value >
void aitools::invertedindex::IndexBuilder< Value >::index_sorted_records_ (  )  throw (std::exception) [inline, private]

Definition at line 286 of file IndexBuilder.hpp.

template<typename Value >
bfs::path aitools::invertedindex::IndexBuilder< Value >::partition_records_ (  )  throw (std::exception) [inline, private]

Definition at line 358 of file IndexBuilder.hpp.

template<typename Value >
void aitools::invertedindex::IndexBuilder< Value >::print_header ( const Header header  )  [inline, static, private]

Definition at line 196 of file IndexBuilder.hpp.

template<typename Value >
void aitools::invertedindex::IndexBuilder< Value >::store_header ( const Header header,
const bfs::path &  path 
) throw (std::exception) [inline, static, private]

Definition at line 179 of file IndexBuilder.hpp.


Member Data Documentation

template<typename Value>
Configuration aitools::invertedindex::IndexBuilder< Value >::config_ [private]

Definition at line 82 of file IndexBuilder.hpp.

template<typename Value>
Header aitools::invertedindex::IndexBuilder< Value >::header_ [private]

Definition at line 81 of file IndexBuilder.hpp.

template<typename Value>
const std::string aitools::invertedindex::IndexBuilder< Value >::header_file [inline, static]

Definition at line 32 of file IndexBuilder.hpp.

template<typename Value>
RecordReader<Value>* aitools::invertedindex::IndexBuilder< Value >::reader_ [private]

Definition at line 83 of file IndexBuilder.hpp.

template<typename Value>
const std::string aitools::invertedindex::IndexBuilder< Value >::tmp_dir [inline, static, private]

Definition at line 27 of file IndexBuilder.hpp.

template<typename Value>
const std::string aitools::invertedindex::IndexBuilder< Value >::tmp_file [inline, static, private]

Definition at line 28 of file IndexBuilder.hpp.


The documentation for this class was generated from the following file:
Generated on Wed May 30 15:07:33 2012 by  doxygen 1.6.3