#include <corpus.h>
Collaboration diagram for PhraseHunter::CorpusManager:
Public Types | |
enum | Mode { Read = 1, Write = 2 } |
The mode in which a CorpusManager object should operate. More... | |
Public Member Functions | |
CorpusManager (const std::string &corpus_repository, CorpusManager::Mode mode=Read) throw (Exceptions::NoSuchCorpusError) | |
Constructor. | |
~CorpusManager () | |
SearchEngine * | searchEngine () |
Factory function that returns a pointer to a newly constructed SearchEngine object. | |
StatisticsEngine * | statisticsEngine () |
Factory function that returns a pointer to a newly constructed StatisticsEngine object. | |
ContextReader * | contextReader () |
Factory function that returns a pointer to a newly constructed ContextReader object. | |
std::string | documentName (DocID docID) |
Get the file name for a particular DocID. | |
void | addFile (const std::string &filename, const std::string &info) throw (Exceptions::FileError, Exceptions::NoIndexerError, std::out_of_range) |
Add a file to the repository. | |
void | removeFile (DocID docID) throw (Exceptions::NoIndexerError) |
Remove a particular file from the repository. | |
Private Member Functions | |
boost::filesystem::path | textDir () |
boost::filesystem::path | indexFile () |
Private Attributes | |
CorpusManager::Mode | m_mode |
IndexManager * | m_indexer |
const boost::filesystem::path | m_directory |
SearchEngine * | m_searchEngine |
StatisticsEngine * | m_statistics |
ContextReader * | m_contextReader |
SQLitePP::SqliteDB | m_db |
Classes | |
struct | Repository |
Definition at line 37 of file corpus.h.
The mode in which a CorpusManager object should operate.
PhraseHunter::CorpusManager::CorpusManager | ( | const std::string & | corpus_repository, | |
CorpusManager::Mode | mode = Read | |||
) | throw (Exceptions::NoSuchCorpusError) |
Constructor.
corpus_repository | Path to the base directory of the corpus. | |
mode | The mode in which a CorpusManager object should operate. |
Definition at line 47 of file corpus.cpp.
References qt4::exists().
PhraseHunter::CorpusManager::~CorpusManager | ( | ) |
SearchEngine * PhraseHunter::CorpusManager::searchEngine | ( | ) |
Factory function that returns a pointer to a newly constructed SearchEngine object.
Definition at line 70 of file corpus.cpp.
References m_db, and m_searchEngine.
Referenced by SearchTab::enableSearch(), main(), and statisticsEngine().
StatisticsEngine * PhraseHunter::CorpusManager::statisticsEngine | ( | ) |
Factory function that returns a pointer to a newly constructed StatisticsEngine object.
Definition at line 78 of file corpus.cpp.
References contextReader(), m_db, m_statistics, and searchEngine().
Referenced by SearchTab::enableSearch(), and PhSearchImpl::fileOpen().
ContextReader * PhraseHunter::CorpusManager::contextReader | ( | ) |
Factory function that returns a pointer to a newly constructed ContextReader object.
Definition at line 86 of file corpus.cpp.
References m_contextReader, and textDir().
Referenced by SearchTab::enableSearch(), PhSearchImpl::openDocument(), and statisticsEngine().
std::string PhraseHunter::CorpusManager::documentName | ( | DocID | docID | ) |
Get the file name for a particular DocID.
Definition at line 94 of file corpus.cpp.
References SQLitePP::ResultIterator::get(), SQLitePP::ResultIterator::hasMoreRows(), m_db, and SQLitePP::SqliteDB::statement().
void PhraseHunter::CorpusManager::addFile | ( | const std::string & | filename, | |
const std::string & | info | |||
) | throw (Exceptions::FileError, Exceptions::NoIndexerError, std::out_of_range) |
Add a file to the repository.
filename | The file to be added | |
info | String holding information about this file. Will be written to info file. |
Definition at line 108 of file corpus.cpp.
Referenced by main().
void PhraseHunter::CorpusManager::removeFile | ( | DocID | docID | ) | throw (Exceptions::NoIndexerError) |
boost::filesystem::path PhraseHunter::CorpusManager::textDir | ( | ) | [inline, private] |
Definition at line 78 of file corpus.h.
References m_directory, and PhraseHunter::CorpusManager::Repository::TextDirectory.
Referenced by contextReader().
boost::filesystem::path PhraseHunter::CorpusManager::indexFile | ( | ) | [inline, private] |
Definition at line 83 of file corpus.h.
References PhraseHunter::CorpusManager::Repository::IndexFile, and m_directory.
const boost::filesystem::path PhraseHunter::CorpusManager::m_directory [private] |
Definition at line 94 of file corpus.h.
Referenced by documentName(), searchEngine(), and statisticsEngine().