PhraseHunter::CorpusToken Class Reference

A Token of only one word. More...

#include <token.h>

Inherits PhraseHunter::CorpusTokenBase.

Inheritance diagram for PhraseHunter::CorpusToken:

Inheritance graph
[legend]
Collaboration diagram for PhraseHunter::CorpusToken:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool isEmpty () const
 Returns true if this Token has no occurrences in the corpus.

Static Public Member Functions

template<typename T>
static TokenPtr loadFromCorpus (T tokenstr, TokenID id, SQLitePP::SqliteDB &db)
 Don't call this template function directly. Instead, use the non-template version below.
template<typename T>
static TokenPtr loadFromCorpus (T tokenstr, TokenID id, SQLitePP::SqliteDB &db, const std::set< DocID > &docs)
 Don't call this template function directly. Instead, use the non-template version below.
static TokenPtr loadFromToken (const TokenPtr &token, SQLitePP::SqliteDB &db)
 Loads a CorpusToken. For initializing the OccurrenceMap of a LightCorpusToken.
static TokenPtr loadFromToken (const TokenPtr &token, SQLitePP::SqliteDB &db, const std::set< DocID > &docs)
 Like above function, but ignoring all occurrences that are not in docs.

Private Member Functions

void insertPositions (SQLitePP::ResultIterator)
 CorpusToken (const char *, TokenID, SQLitePP::SqliteDB &)
 CorpusToken (const char *, TokenID, SQLitePP::SqliteDB &, const std::set< DocID > &)
 CorpusToken (schma::UnicodePtr, TokenID, SQLitePP::SqliteDB &)
 CorpusToken (schma::UnicodePtr, TokenID, SQLitePP::SqliteDB &, const std::set< DocID > &)
void init (TokenID, SQLitePP::SqliteDB &)
void init (TokenID, SQLitePP::SqliteDB &, const std::set< DocID > &)

Detailed Description

A Token of only one word.

This is a non-phrasal Token. For reading only. A PhraseHunter::CorpusToken has an individual id, by which it can uniquely be identified and called from the database.

Definition at line 152 of file token.h.


Constructor & Destructor Documentation

PhraseHunter::CorpusToken::CorpusToken ( const char *  ,
TokenID  ,
SQLitePP::SqliteDB  
) [private]

Definition at line 61 of file token.cpp.

References init().

Referenced by loadFromCorpus().

PhraseHunter::CorpusToken::CorpusToken ( const char *  ,
TokenID  ,
SQLitePP::SqliteDB ,
const std::set< DocID > &   
) [private]

Definition at line 67 of file token.cpp.

References init().

PhraseHunter::CorpusToken::CorpusToken ( schma::UnicodePtr  ,
TokenID  ,
SQLitePP::SqliteDB  
) [private]

Definition at line 73 of file token.cpp.

References init().

PhraseHunter::CorpusToken::CorpusToken ( schma::UnicodePtr  ,
TokenID  ,
SQLitePP::SqliteDB ,
const std::set< DocID > &   
) [private]

Definition at line 79 of file token.cpp.

References init().


Member Function Documentation

void PhraseHunter::CorpusToken::insertPositions ( SQLitePP::ResultIterator   )  [private]

Definition at line 43 of file token.cpp.

References SQLitePP::ResultIterator::get(), SQLitePP::ResultIterator::hasMoreRows(), PhraseHunter::CorpusTokenBase::m_corpusfreq, PhraseHunter::Token::m_occurrences, and SQLitePP::ResultIterator::next().

Referenced by init().

void PhraseHunter::CorpusToken::init ( TokenID  ,
SQLitePP::SqliteDB  
) [private]

Definition at line 85 of file token.cpp.

References SQLitePP::SqliteDB::cachedStatement(), and insertPositions().

Referenced by CorpusToken().

void PhraseHunter::CorpusToken::init ( TokenID  ,
SQLitePP::SqliteDB ,
const std::set< DocID > &   
) [private]

Definition at line 92 of file token.cpp.

References insertPositions(), and SQLitePP::SqliteDB::statement().

template<typename T>
static TokenPtr PhraseHunter::CorpusToken::loadFromCorpus ( tokenstr,
TokenID  id,
SQLitePP::SqliteDB db 
) [inline, static]

Don't call this template function directly. Instead, use the non-template version below.

Definition at line 167 of file token.h.

References CorpusToken(), PhraseHunter::InvalidTokenID, and p_assert.

Referenced by PhraseHunter::StatisticsEngine::getCandidates(), and PhraseHunter::SearchEngine::searchToken().

template<typename T>
static TokenPtr PhraseHunter::CorpusToken::loadFromCorpus ( tokenstr,
TokenID  id,
SQLitePP::SqliteDB db,
const std::set< DocID > &  docs 
) [inline, static]

Don't call this template function directly. Instead, use the non-template version below.

Definition at line 175 of file token.h.

References CorpusToken(), PhraseHunter::EmptyToken::instance(), PhraseHunter::InvalidTokenID, and p_assert.

static TokenPtr PhraseHunter::CorpusToken::loadFromToken ( const TokenPtr token,
SQLitePP::SqliteDB db 
) [inline, static]

Loads a CorpusToken. For initializing the OccurrenceMap of a LightCorpusToken.

Returns:
The so-(re)loaded CorpusToken

Definition at line 188 of file token.h.

static TokenPtr PhraseHunter::CorpusToken::loadFromToken ( const TokenPtr token,
SQLitePP::SqliteDB db,
const std::set< DocID > &  docs 
) [inline, static]

Like above function, but ignoring all occurrences that are not in docs.

Returns:
The so-(re)loaded CorpusToken

Definition at line 196 of file token.h.

bool PhraseHunter::CorpusToken::isEmpty (  )  const [inline, virtual]

Returns true if this Token has no occurrences in the corpus.

Reimplemented from PhraseHunter::Token.

Definition at line 202 of file token.h.

References PhraseHunter::CorpusTokenBase::m_corpusfreq.


The documentation for this class was generated from the following files:
Generated on Thu Dec 21 16:14:44 2006 for The Phrasehunter by  doxygen 1.5.1