Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

CIndexSetForQueryingStage Class Reference

#include <IndexSetForQueryingStage.h>

Inheritance diagram for CIndexSetForQueryingStage:
Inheritance graph
[legend]
Collaboration diagram for CIndexSetForQueryingStage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Public Attributes

Protected Member Functions

Private Member Functions

Private Attributes


Detailed Description

This class is a part of CStringIndexSet class which is used only during querying. It contains the important serialization primitives.


Constructor & Destructor Documentation

CIndexSetForQueryingStage::CIndexSetForQueryingStage ( const CStringIndexator pParent  ) 

References m_OccursFp, and m_pParent.

CIndexSetForQueryingStage::~CIndexSetForQueryingStage (  ) 

References CloseOccursFile().

Here is the call graph for this function:


Member Function Documentation

void CIndexSetForQueryingStage::CloseOccursFile (  )  [private]

close m_OccursFp

References m_OccursFp.

Referenced by DestroyIndexSet(), LoadIndexSet(), and ~CIndexSetForQueryingStage().

Here is the caller graph for this function:

bool CIndexSetForQueryingStage::LoadPeriodDevision (  )  [private]

load all period divisions to m_EndPeriodOffsets

References FileSize(), GetPeriodsDevisionFileName(), CStringIndexator::GetSearchPeriodsCount(), m_EndPeriodOffsets, m_pParent, CExpc::m_strCause, and ReadVectorInner().

Referenced by LoadIndexSet().

Here is the call graph for this function:

Here is the caller graph for this function:

void CIndexSetForQueryingStage::AssertHasPath (  )  const [protected]

return true, if the project path is initialized

References ErrorMessage(), errUnknownPath, CStringIndexator::m_Path, and m_pParent.

Referenced by DestroyIndexSet(), GetFileNameForInfos(), GetOccHdrFileName(), GetOccurrsFileSize(), GetOccursFileName(), and GetPeriodsDevisionFileName().

Here is the call graph for this function:

Here is the caller graph for this function:

void CIndexSetForQueryingStage::AddOccurs ( size_t  IndexItemNo,
const bool  bOneOccurrence,
const size_t  StartOccurNo,
const size_t  EndOccurNo,
vector< CTokenNo > &  Occurs,
size_t  PeriodNo,
COccurrBuffer OccursBuffer,
CShortOccurCache pCacheByIndexSet,
int &  CacheId 
) const [protected]
string CIndexSetForQueryingStage::GetOccursFileName (  )  const [protected]

return the file name for the file occurrences

References AssertHasPath(), GetName(), CStringIndexator::m_Path, m_pParent, and MakeFName().

Referenced by CStringIndexSet::ConvertLoadIndexToWorkingIndex(), CIndexSetForBigrams::ConvertTempBigramsToPersistent(), DestroyIndexSet(), GetOccurrsFileSize(), LoadIndexSet(), and CStringIndexSet::UnionIndexSet().

Here is the call graph for this function:

Here is the caller graph for this function:

string CIndexSetForQueryingStage::GetOccHdrFileName (  )  const [protected]

return the name of file for m_Index

References AssertHasPath(), GetName(), CStringIndexator::m_Path, m_pParent, and MakeFName().

Referenced by DestroyIndexSet(), LoadIndexSet(), and CStringIndexSet::WriteToFile().

Here is the call graph for this function:

Here is the caller graph for this function:

string CIndexSetForQueryingStage::GetPeriodsDevisionFileName (  )  const [protected]

return the name of file for occurrences period division

References AssertHasPath(), GetName(), CStringIndexator::m_Path, m_pParent, and MakeFName().

Referenced by DestroyIndexSet(), LoadPeriodDevision(), and WritePeriodsDivision().

Here is the call graph for this function:

Here is the caller graph for this function:

string CIndexSetForQueryingStage::GetFileNameForInfos (  )  const [protected]

return the name of file for CIndexSetForLoadingStage::m_StringBuffer

References AssertHasPath(), GetName(), CStringIndexator::m_Path, m_pParent, and MakeFName().

Referenced by DestroyIndexSet(), CStringIndexSet::ReadFromTheDisk(), and CStringIndexSet::WriteToFile().

Here is the call graph for this function:

Here is the caller graph for this function:

file_off_t CIndexSetForQueryingStage::GetOccurrsFileSize (  )  const [protected]

return the size of the file for occurrences

References AssertHasPath(), FileSize(), and GetOccursFileName().

Here is the call graph for this function:

size_t CIndexSetForQueryingStage::GetStartOccurNo ( size_t  IndexNo  )  const [protected]

get the offset of the first occurrence of index item no IndexNo in the file of occurrences(m_OccursFp)

References m_Index.

Referenced by CStringIndexSet::FindChunkOccurrences(), CStringIndexSet::FindOccurrences(), and ReadAllOccurrences().

Here is the caller graph for this function:

bool CIndexSetForQueryingStage::BuildPeriodsDivisionAndCompress ( const DWORD  TokenId,
vector< CTokenNo > &  InputTokens 
) [protected]

build a period division for one index item

References CompressPortion(), GetName(), CStringIndexator::GetSearchPeriod(), CStringIndexator::GetSearchPeriodsCount(), m_bCompressOccurrences, m_EndPeriodOffsets, m_pParent, and OccurBufferSize.

Referenced by AddOneIndexItem(), and CIndexSetForBigrams::WriteBigramAndItsOccurs().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CIndexSetForQueryingStage::AddOneIndexItem ( CItemIndexForLoading M,
FILE *  res_fp,
size_t &  CurrPositionInResFile,
const CTokenNo  EndTokeNo 
) [protected]
bool CIndexSetForQueryingStage::WritePeriodsDivision (  )  [protected]
virtual string CIndexSetForQueryingStage::GetName (  )  const [pure virtual]

return the name of the index (CStringIndexSet::m_Name)

Implemented in CIndexSetForBigrams, and CStringIndexSet.

Referenced by AddOneIndexItem(), BuildPeriodsDivisionAndCompress(), GetFileNameForInfos(), GetOccHdrFileName(), GetOccursFileName(), and GetPeriodsDevisionFileName().

Here is the caller graph for this function:

bool CIndexSetForQueryingStage::LoadIndexSet ( bool  bLoadHeaderOfOccurrences = true  ) 

load index set from binaries

References CloseOccursFile(), GetOccHdrFileName(), GetOccursFileName(), LoadPeriodDevision(), m_Index, m_OccursFp, and ReadVector().

Referenced by CConcIndexator::CreateMorphIndex(), and CStringIndexSet::ReadFromTheDisk().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CIndexSetForQueryingStage::DestroyIndexSet (  ) 

destroy index set and remove index files

Reimplemented in CIndexSetForBigrams, and CStringIndexSet.

References AssertHasPath(), ClearVector(), CloseOccursFile(), FileExists(), GetFileNameForInfos(), GetOccHdrFileName(), GetOccursFileName(), GetPeriodsDevisionFileName(), m_EndPeriodOffsets, and m_Index.

Referenced by CStringIndexSet::DestroyIndexSet(), and CIndexSetForBigrams::DestroyIndexSet().

Here is the call graph for this function:

Here is the caller graph for this function:

void CIndexSetForQueryingStage::ReadAllOccurrences ( size_t  IndexItemNo,
vector< CTokenNo > &  Occurs 
) const

reads all occurrences of IndexItemNo (this function can allocate much memory; it should be used carefully)

References AddOccurs(), CStringIndexator::GetSearchPeriodsCount(), GetStartOccurNo(), m_Index, and m_pParent.

Referenced by CConcIndexator::CreateMorphIndex(), and CStringIndexSet::UnionIndexSet().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

the main file of occurrences

Referenced by AddOccurs(), CIndexSetForQueryingStage(), CloseOccursFile(), and LoadIndexSet().

if true, then the occurrences should be compresses (up to 30% for huge corpora)

Referenced by AddOccurs(), BuildPeriodsDivisionAndCompress(), CIndexSetForBigrams::CIndexSetForBigrams(), and CStringIndexSet::InitIndexSet().


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