ModErn Text Analysis
META Enumerates Textual Applications
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
meta::index::disk_index Class Reference

Holds generic data structures and functions that inverted_index and forward_index both use. More...

#include <disk_index.h>

Inheritance diagram for meta::index::disk_index:
meta::index::forward_index meta::index::inverted_index

Classes

class  disk_index_impl
 The implementation of a disk_index. More...
 

Public Member Functions

virtual ~disk_index ()=default
 Default destructor.
 
std::string index_name () const
 
uint64_t num_docs () const
 
std::string doc_name (doc_id d_id) const
 
std::string doc_path (doc_id d_id) const
 
std::vector< doc_id > docs () const
 
uint64_t doc_size (doc_id d_id) const
 
class_label label (doc_id d_id) const
 
label_id lbl_id (doc_id d_id) const
 
label_id id (class_label label) const
 
class_label class_label_from_id (label_id l_id) const
 
uint64_t num_labels () const
 
std::vector< class_label > class_labels () const
 
virtual uint64_t unique_terms (doc_id d_id) const
 
virtual uint64_t unique_terms () const
 
term_id get_term_id (const std::string &term)
 
std::string term_text (term_id t_id) const
 
 disk_index (disk_index &&)=default
 Move constructs a disk_index.
 
disk_indexoperator= (disk_index &&)=default
 Move assigns a disk_index.
 

Protected Member Functions

 disk_index (const cpptoml::table &config, const std::string &name)
 Constructor. More...
 
 disk_index (const disk_index &)=delete
 disk_index may not be copy-constructed.
 
disk_indexoperator= (const disk_index &)=delete
 disk_index may not be copy-assigned.
 

Protected Attributes

util::pimpl< disk_index_implimpl_
 Implementation of this disk_index.
 

Detailed Description

Holds generic data structures and functions that inverted_index and forward_index both use.

Provides common interface for both and is implemented using the pointer-to-implementation method.

Constructor & Destructor Documentation

meta::index::disk_index::disk_index ( const cpptoml::table &  config,
const std::string &  name 
)
protected

Constructor.

Parameters
configThe config settings used to create this index
nameThe name of this disk_index

Member Function Documentation

std::string meta::index::disk_index::index_name ( ) const
Returns
the name of this index
uint64_t meta::index::disk_index::num_docs ( ) const
Returns
the number of documents in this index
std::string meta::index::disk_index::doc_name ( doc_id  d_id) const
Parameters
d_id
Returns
the actual name of this document
std::string meta::index::disk_index::doc_path ( doc_id  d_id) const
Parameters
d_id
Returns
the path to the file containing this document
std::vector< doc_id > meta::index::disk_index::docs ( ) const
Returns
a vector of doc_ids that are contained in this index
uint64_t meta::index::disk_index::doc_size ( doc_id  d_id) const
Parameters
d_idThe document to search for
Returns
the size of the given document (the total number of terms occurring)
class_label meta::index::disk_index::label ( doc_id  d_id) const
Parameters
d_idThe doc id to find the class label for
Returns
the label of the class that the document belongs to, or an empty string if a label was not assigned
label_id meta::index::disk_index::lbl_id ( doc_id  d_id) const
Parameters
d_idTHe doc id to find the label_id for
Returns
the label_id of the class that to document belongs to
label_id meta::index::disk_index::id ( class_label  label) const
Parameters
labelThe class label
Returns
the label_id for the given class label
class_label meta::index::disk_index::class_label_from_id ( label_id  l_id) const
Parameters
l_idThe id of the class label in question
Returns
the integer label id of a document
uint64_t meta::index::disk_index::num_labels ( ) const
Returns
the number of labels in this index
std::vector< class_label > meta::index::disk_index::class_labels ( ) const
Returns
the distinct class labels possible for documents in this index
uint64_t meta::index::disk_index::unique_terms ( doc_id  d_id) const
virtual
Parameters
d_id
Returns
the number of unique terms in d_id
uint64_t meta::index::disk_index::unique_terms ( ) const
virtual
Returns
the number of unique terms in the index

Reimplemented in meta::index::forward_index.

term_id meta::index::disk_index::get_term_id ( const std::string &  term)
Parameters
term
Returns
the term_id associated with the parameter
std::string meta::index::disk_index::term_text ( term_id  t_id) const
Parameters
t_idThe term_id to get the original text for
Returns
the string representation of the term

The documentation for this class was generated from the following files: