Colibri Core
Public Types | Public Member Functions | Public Attributes | List of all members
IndexedData Class Reference

Collection of references to position in the corpus (IndexReference). Used by Indexed Pattern models. More...

#include <datatypes.h>

Public Types

typedef std::vector< IndexReference >::iterator iterator
 
typedef std::vector< IndexReference >::const_iterator const_iterator
 

Public Member Functions

 IndexedData ()
 
 IndexedData (std::istream *in)
 
void write (std::ostream *out) const
 
bool has (const IndexReference &ref, bool sorted=false) const
 
unsigned int count () const
 
void insert (IndexReference ref)
 
size_t size () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
iterator find (const IndexReference &ref)
 
const_iterator find (const IndexReference &ref) const
 
std::set< int > sentences () const
 
std::set< IndexReferenceset () const
 
void sort ()
 
void reserve (size_t size)
 
void shrink_to_fit ()
 

Public Attributes

std::vector< IndexReferencedata
 

Detailed Description

Collection of references to position in the corpus (IndexReference). Used by Indexed Pattern models.

Member Typedef Documentation

Constructor & Destructor Documentation

IndexedData::IndexedData ( )
inline
IndexedData::IndexedData ( std::istream *  in)

Member Function Documentation

iterator IndexedData::begin ( )
inline
const_iterator IndexedData::begin ( ) const
inline
unsigned int IndexedData::count ( ) const
inline

Returns the number of indices in the collection, i.e. the occurrence count.

iterator IndexedData::end ( )
inline
const_iterator IndexedData::end ( ) const
inline
iterator IndexedData::find ( const IndexReference ref)
inline
const_iterator IndexedData::find ( const IndexReference ref) const
inline
bool IndexedData::has ( const IndexReference ref,
bool  sorted = false 
) const
inline
void IndexedData::insert ( IndexReference  ref)
inline
void IndexedData::reserve ( size_t  size)
inline
std::set<int> IndexedData::sentences ( ) const
inline

Returns a set of all unique sentences covered by this collection of references.

std::set<IndexReference> IndexedData::set ( ) const
inline

Conversion to std::set<IndexReference>

void IndexedData::shrink_to_fit ( )
inline
size_t IndexedData::size ( ) const
inline
void IndexedData::sort ( )
inline

Sort the indices, in-place, in proper order of occurence

void IndexedData::write ( std::ostream *  out) const

Member Data Documentation

std::vector<IndexReference> IndexedData::data

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