#include <Bibliography.h>
typedef map<string, CFreeBiblIndex*> CConcXml::FreeBiblStringMap [private] |
CConcXml::CConcXml | ( | ) |
References m_BiblBodyFile.
CConcXml::~CConcXml | ( | ) |
void CConcXml::DeleteFiles | ( | ) | [private] |
References GetBiblDateIndexFileName(), GetBiblFileName(), GetBiblIndexFileName(), m_FreeBiblIndices, and m_Path.
Referenced by ExitWithoutSave().
string CConcXml::GetBiblIndexFileName | ( | ) | const [private] |
References m_Path, and MakeFName().
Referenced by DeleteFiles(), FinalSaveBibliography(), LoadBibl(), and UniteBibliography().
string CConcXml::GetBiblFileName | ( | ) | const [private] |
References m_Path, and MakeFName().
Referenced by CheckBibl(), DeleteFiles(), LoadBibl(), Start(), and UniteBibliography().
string CConcXml::GetBiblDateIndexFileName | ( | ) | const [private] |
References m_Path, and MakeFName().
Referenced by DeleteFiles(), FinalSaveBibliography(), LoadBibl(), and UniteBibliography().
int CConcXml::GetTextAreaByName | ( | const string & | Name | ) | const [private] |
References m_TextAreas, and UnknownTextAreaNo.
Referenced by ProcessTextAreaNoInQueryStr().
void CConcXml::FreeBiblIndices | ( | ) |
clears m_FreeBiblIndices
References m_FreeBiblIndices.
Referenced by RegisterFreeBiblAttributes(), and ~CConcXml().
bool CConcXml::Start | ( | string | ProjectFileName | ) |
initialize building bibliography for corpus ProjectFileName
References GetBiblFileName(), m_BiblBodyFile, m_BiblBodyFileSize, m_Dates, m_EndOffsetsInBiblFile, m_FreeBiblIndices, and SetPath().
Referenced by CConcIndexator::StartIndexing().
bool CConcXml::AddIndexItem | ( | const CBibliography & | Bibliography | ) |
add one record Bibliography
References CBibliography::ConvertDateToInt(), CBibliography::m_BiblAttribs, m_BiblBodyFile, m_BiblBodyFileSize, m_Dates, m_EndOffsetsInBiblFile, m_FreeBiblIndices, and CBibliography::WriteToString().
Referenced by CConcIndexator::IndexMorphXml(), CConcIndexator::IndexTable(), and CConcIndexator::IndexTextOrHtmlFile().
bool CConcXml::FinalSaveBibliography | ( | ) |
save all indices and stop indexing bibliography
References FileExists(), GetBiblDateIndexFileName(), GetBiblIndexFileName(), m_BiblBodyFile, m_BiblBodyFileSize, m_Dates, m_EndOffsetsInBiblFile, m_FreeBiblIndices, m_Path, and WriteVector().
Referenced by CConcIndexator::NormalEndIndexing().
void CConcXml::ExitWithoutSave | ( | ) |
stop indexing bibliography an removes index files
References DeleteFiles(), m_BiblBodyFile, and m_BiblBodyFileSize.
Referenced by CConcIndexator::TerminateIndexing().
bool CConcXml::RegisterFreeBiblAttributes | ( | string | fields, | |
string & | ErrorStr | |||
) |
initializes free bibliographical attribute descriptions
References CheckXPath(), Format(), FreeBiblAttribOptionFieldName, FreeBiblIndices(), IntegerTypeStr, CConcXml::CFreeBiblIndex::m_bShowInHeader, m_DateXPath, m_FreeBiblIndices, CConcXml::CFreeBiblIndex::m_Name, m_OrigXPath, m_ScanXPath, m_StartPageXPath, CConcXml::CFreeBiblIndex::m_Xpath, Name, StringTypeStr, and Trim().
Referenced by CConcIndexator::LoadOptionsFromString(), and UniteBibliography().
bool CConcXml::RegisterTextAreas | ( | string | fields, | |
string & | ErrorStr | |||
) |
initializes free text areas descriptions
References CheckXPath(), CConcXml::CTextArea::m_TextAreaName, m_TextAreas, CConcXml::CTextArea::m_Xpath, morphEnglish, RmlMakeLower(), TextAreaOptionFieldName, and Trim().
Referenced by CConcIndexator::LoadOptionsFromString(), and UniteBibliography().
string CConcXml::GetFreeBibiAttributesDescr | ( | ) | const |
return free bibliographical attribute description
References Format(), FreeBiblAttribOptionFieldName, m_DateXPath, m_FreeBiblIndices, m_OrigXPath, m_ScanXPath, and m_StartPageXPath.
Referenced by CConcIndexator::LoadOptionsFromString(), CConcIndexator::SaveOptionsToString(), and UniteBibliography().
string CConcXml::GetTextAreasDescr | ( | ) | const |
return full text area description
References Format(), m_TextAreas, and TextAreaOptionFieldName.
Referenced by CConcIndexator::LoadOptionsFromString(), and UniteBibliography().
void CConcXml::SetPath | ( | string | ProjectFileName | ) |
References m_Path.
Referenced by CConcIndexator::CreateAsUnion(), LoadBibl(), and Start().
bool CConcXml::LoadBibl | ( | string | Path, | |
size_t | FileBreaksSize | |||
) |
References ErrorMessage(), Format(), GetBiblDateIndexFileName(), GetBiblFileName(), GetBiblIndexFileName(), m_BiblBodyFile, m_Dates, m_EndOffsetsInBiblFile, m_FreeBiblIndices, m_Path, ReadVector(), and SetPath().
Referenced by CConcIndexator::LoadProject().
CBibliography CConcXml::GetFullBibliographyOfHit | ( | size_t | FileNo | ) | const |
returns the bibliographical record
References FSeek(), m_BiblBodyFile, m_EndOffsetsInBiblFile, and CBibliography::ReadFromString().
Referenced by CConcHolder::GenerateOneHitStringJson(), CConcHolder::ShowBibliographyForTable(), and CConcHolder::ShowBibliographyForTextOrHtml().
bool CConcXml::CheckBibl | ( | size_t | FileBreaksNumber | ) | const |
Check bibliographical references.
References FileSize(), GetBiblFileName(), and m_EndOffsetsInBiblFile.
References AddFile(), FileExists(), FileSize(), GetBiblDateIndexFileName(), GetBiblFileName(), GetBiblIndexFileName(), GetFreeBibiAttributesDescr(), GetTextAreasDescr(), m_Dates, m_EndOffsetsInBiblFile, m_FreeBiblIndices, m_Path, RegisterFreeBiblAttributes(), RegisterTextAreas(), and WriteVector().
Referenced by CConcIndexator::CreateAsUnion().
bool CConcXml::GetValueFromBiblSet | ( | const RML_RE::Options & | RegexOpts, | |
string | Value, | |||
CDDCFilterWithBounds & | Filter | |||
) | const |
initializes CDDCFilterWithBounds::m_LevelStart and CDDCFilterWithBounds::m_LevelEnd for filtering by bibliographical information
References CDDCFilterWithBounds::m_bRegExp, CDDCFilterWithBounds::m_FreeBiblAttribName, m_FreeBiblIndices, and CDDCFilterWithBounds::m_SatisfiedValues.
Referenced by CQueryParser::ParseQueryOperators().
bool CConcXml::LoadXmlAndReadBibliography | ( | TiXmlDocument & | doc, | |
const char * | pFileBuffer, | |||
CBibliography & | Bibl, | |||
string & | strError | |||
) |
load xml file into TiXmlDocument& doc and load bibliographical fileds to CBibliography& Bibl
References CBibliography::CleanBibliography(), CBibliography::ConvertDateToInt(), TiXmlDocument::Error(), TiXmlDocument::ErrorCol(), TiXmlDocument::ErrorDesc(), TiXmlDocument::ErrorRow(), Format(), CBibliography::m_BiblAttribs, CBibliography::m_DateStr, m_DateXPath, m_FreeBiblIndices, CBibliography::m_OrigBibl, m_OrigXPath, CBibliography::m_ScanBibl, m_ScanXPath, CBibliography::m_StartPageInfo, m_StartPageXPath, TiXmlDocument::Parse(), ReadXmlField(), and UnknownPageNumber.
Referenced by CConcIndexator::IndexTable(), CConcIndexator::LoadXmlFile(), and ReadMorphXmlFileIntoGraTable().
bool CConcXml::ReadMorphXmlFileIntoGraTable | ( | string | FileName, | |
const char * | pFileBuffer, | |||
vector< CXmlToken > & | GraTable, | |||
string & | strError, | |||
CBibliography & | Bibl | |||
) |
load xml file under MorphXML_Index into vector<CXmlToken>& GraTable
References TiXmlNode::FirstChildElement(), Format(), GetTextAreaElements(), LoadXmlAndReadBibliography(), CXmlToken::m_Annots, CXmlMorphAnnot::m_GrammemsStr, CXmlMorphAnnot::m_Lemma, CXmlToken::m_Type, CXmlToken::m_WordStr, TiXmlNode::NextSiblingElement(), Trim(), and TiXmlNode::Value().
Referenced by CConcIndexator::IndexMorphXml().
string CConcXml::GetVisibleFreeHeaderBiblAttributes | ( | size_t | FileNo, | |
string | Delim | |||
) | const |
return values of all visible free bibliographical attributes for the given FileNo delimited by "Delim"
References CConcXml::CFreeBiblIndex::GetStringValue(), CConcXml::CFreeBiblIndex::m_bShowInHeader, and m_FreeBiblIndices.
Referenced by CConcHolder::ShowBibliographyForTextOrHtml().
string CConcXml::GetFreeHeaderBiblAttributesWithNames | ( | size_t | FileNo, | |
char | Delim | |||
) | const |
return names and values of all free bibliographical attributes for the given FileNo delimited by "Delim"
References CConcXml::CFreeBiblIndex::GetStringValue(), CConcXml::CFreeBiblIndex::m_bShowInHeader, m_FreeBiblIndices, and CConcXml::CFreeBiblIndex::m_Name.
Referenced by CConcHolder::ShowBibliographyForTable().
string CConcXml::GetFreeHeaderBiblAttributesJson | ( | size_t | FileNo, | |
bool | assume_utf8 = true | |||
) | const |
return names and values of all free bibliographical attributes for the given FileNo as JSON (without enclosing {})
References CConcXml::CFreeBiblIndex::GetStringValue(), jsonStr(), CConcXml::CFreeBiblIndex::m_bShowInHeader, m_FreeBiblIndices, and CConcXml::CFreeBiblIndex::m_Name.
Referenced by CConcHolder::GenerateOneHitStringJson().
void CConcXml::SetFreeBiblAttribsEmpty | ( | CBibliography & | Bibl | ) |
set all free bibliographical attributes to ""
References CBibliography::m_BiblAttribs, and m_FreeBiblIndices.
Referenced by CConcIndexator::LoadFileIntoGraphan().
bool CConcXml::GetTextAreaElements | ( | const TiXmlDocument & | doc, | |
vector< TiXmlElement * > & | Result, | |||
string & | strError | |||
) | const |
return all text area elements for this document ("doc")
References Format(), m_TextAreas, TiXmlDocument::RootElement(), TiXmlNode::ToElement(), and TinyXPath::XNp_xpath_node().
Referenced by CConcIndexator::IndexTable(), CConcIndexator::LoadXmlFile(), and ReadMorphXmlFileIntoGraTable().
size_t CConcXml::GetTextAreasCount | ( | ) | const |
return all text area names
References m_TextAreas.
Referenced by CQueryNode::ConvertOccurrencesToHits(), CQueryNode::ConvertOccurrencesToHitsForPatterns(), CConcIndexator::IndexTextOrHtmlFile(), and CConcIndexator::LoadXmlFile().
int CConcXml::ProcessTextAreaNoInQueryStr | ( | string & | Query | ) | const |
return text area index, which is specified in the input query (if nothing is specified, it returns UnknownTextAreaNo)
References GetTextAreaByName(), Trim(), and UnknownTextAreaNo.
Referenced by CQueryParser::ParseQuery().
void CConcXml::InitLessByDate | ( | vector< CHit > & | Hits | ) | const |
References m_Dates, CHit::m_FileNo, and CHit::m_OrderId.
Referenced by CConcHolder::InitOrderIDForHits().
void CConcXml::InitGreaterByDate | ( | vector< CHit > & | Hits | ) | const |
References m_Dates, CHit::m_FileNo, and CHit::m_OrderId.
Referenced by CConcHolder::InitOrderIDForHits().
void CConcXml::InitLessByBiblIntegerField | ( | string | FreeBiblAttribName, | |
vector< CHit > & | Hits | |||
) | const |
References CConcXml::CFreeBiblIndex::GetIntegerValue(), InitNoSort(), CHit::m_FileNo, m_FreeBiblIndices, and CHit::m_OrderId.
Referenced by CConcHolder::InitLessByRank(), and CConcHolder::InitOrderIDForHits().
void CConcXml::InitGreaterByBiblIntegerField | ( | string | FreeBiblAttribName, | |
vector< CHit > & | Hits | |||
) | const |
References CConcXml::CFreeBiblIndex::GetIntegerValue(), InitNoSort(), CHit::m_FileNo, m_FreeBiblIndices, and CHit::m_OrderId.
Referenced by CConcHolder::InitOrderIDForHits().
void CConcXml::InitNoSort | ( | vector< CHit > & | Hits | ) | const |
References CHit::m_OrderId.
Referenced by InitGreaterByBiblIntegerField(), and InitLessByBiblIntegerField().
bool CConcXml::IsRegisteredBiblField | ( | string | FreeBiblAttribName | ) | const |
References m_FreeBiblIndices.
Referenced by CConcHolder::InitLessByRank().
FreeBiblStringMap CConcXml::m_FreeBiblIndices [private] |
Referenced by AddIndexItem(), DeleteFiles(), FinalSaveBibliography(), FreeBiblIndices(), GetFreeBibiAttributesDescr(), GetFreeHeaderBiblAttributesJson(), GetFreeHeaderBiblAttributesWithNames(), GetValueFromBiblSet(), GetVisibleFreeHeaderBiblAttributes(), InitGreaterByBiblIntegerField(), InitLessByBiblIntegerField(), IsRegisteredBiblField(), LoadBibl(), LoadXmlAndReadBibliography(), RegisterFreeBiblAttributes(), SetFreeBiblAttribsEmpty(), Start(), and UniteBibliography().
vector<file_off_t> CConcXml::m_EndOffsetsInBiblFile [private] |
Referenced by AddIndexItem(), CheckBibl(), FinalSaveBibliography(), GetFullBibliographyOfHit(), LoadBibl(), Start(), and UniteBibliography().
vector<int> CConcXml::m_Dates [private] |
Referenced by AddIndexItem(), FinalSaveBibliography(), InitGreaterByDate(), InitLessByDate(), LoadBibl(), Start(), and UniteBibliography().
FILE* CConcXml::m_BiblBodyFile [private] |
Referenced by AddIndexItem(), CConcXml(), ExitWithoutSave(), FinalSaveBibliography(), GetFullBibliographyOfHit(), LoadBibl(), Start(), and ~CConcXml().
string CConcXml::m_Path [private] |
size_t CConcXml::m_BiblBodyFileSize [private] |
Referenced by AddIndexItem(), ExitWithoutSave(), FinalSaveBibliography(), and Start().
string CConcXml::m_OrigXPath [private] |
Referenced by GetFreeBibiAttributesDescr(), LoadXmlAndReadBibliography(), and RegisterFreeBiblAttributes().
string CConcXml::m_ScanXPath [private] |
Referenced by GetFreeBibiAttributesDescr(), LoadXmlAndReadBibliography(), and RegisterFreeBiblAttributes().
string CConcXml::m_DateXPath [private] |
Referenced by GetFreeBibiAttributesDescr(), LoadXmlAndReadBibliography(), and RegisterFreeBiblAttributes().
string CConcXml::m_StartPageXPath [private] |
Referenced by GetFreeBibiAttributesDescr(), LoadXmlAndReadBibliography(), and RegisterFreeBiblAttributes().
vector<CTextArea> CConcXml::m_TextAreas [private] |
Referenced by GetTextAreaByName(), GetTextAreaElements(), GetTextAreasCount(), GetTextAreasDescr(), and RegisterTextAreas().