strusAnalyzer  0.17
Public Member Functions | List of all members
strus::analyzer::Document Class Reference

Structure of a document created as result of a document analysis. More...

#include <document.hpp>

Public Member Functions

 Document ()
 Default constructor. More...
 
 Document (const Document &o)
 Copy constructor. More...
 
const std::string & subDocumentTypeName () const
 Get the sub document type name. More...
 
const std::vector
< DocumentAttribute > & 
attributes () const
 Get the list of the attributes defined in this document. More...
 
const std::vector
< DocumentMetaData > & 
metadata () const
 Get the list of the metadata defined in this document. More...
 
const std::vector< DocumentTerm > & searchIndexTerms () const
 Get the list of the search index terms defined in this document. More...
 
const std::vector< DocumentTerm > & forwardIndexTerms () const
 Get the list of the forward index terms defined in this document. More...
 
void setSubDocumentTypeName (const std::string &n)
 Set the name of the sub document type as declared in the document analyzer (empty for the main document) More...
 
void setAttribute (const std::string &t, const std::string &v)
 Define an attribute of the document. More...
 
void setMetaData (const std::string &t, const NumericVariant &v)
 Define a meta data element of the document. More...
 
void addSearchIndexTerm (const std::string &t, const std::string &v, unsigned int p)
 Define a search index term of the document. More...
 
void addSearchIndexTerms (const std::vector< DocumentTerm > &terms)
 Define a list of search index terms of the document. More...
 
void addForwardIndexTerm (const std::string &t, const std::string &v, unsigned int p)
 Define a forward index term of the document. More...
 
void addForwardIndexTerms (const std::vector< DocumentTerm > &terms)
 Define a list of forward index terms of the document. More...
 
void clear ()
 Clear the document content. More...
 
void swap (Document &o)
 Swap a document structure with another. More...
 

Detailed Description

Structure of a document created as result of a document analysis.

Constructor & Destructor Documentation

strus::analyzer::Document::Document ( )
inline

Default constructor.

strus::analyzer::Document::Document ( const Document o)
inline

Copy constructor.

Member Function Documentation

void strus::analyzer::Document::addForwardIndexTerm ( const std::string &  t,
const std::string &  v,
unsigned int  p 
)
inline

Define a forward index term of the document.

Parameters
[in]ttype name of the forward index term
[in]vvalue of the forward index term
[in]pposition of the forward index term in the document (token position not byte position)
void strus::analyzer::Document::addForwardIndexTerms ( const std::vector< DocumentTerm > &  terms)
inline

Define a list of forward index terms of the document.

Parameters
[in]termslist of terms to add
void strus::analyzer::Document::addSearchIndexTerm ( const std::string &  t,
const std::string &  v,
unsigned int  p 
)
inline

Define a search index term of the document.

Parameters
[in]ttype name of the search index term
[in]vvalue of the search index term
[in]pposition of the search index term in the document (token position not byte position)
void strus::analyzer::Document::addSearchIndexTerms ( const std::vector< DocumentTerm > &  terms)
inline

Define a list of search index terms of the document.

Parameters
[in]termslist of terms to add
const std::vector<DocumentAttribute>& strus::analyzer::Document::attributes ( ) const
inline

Get the list of the attributes defined in this document.

void strus::analyzer::Document::clear ( )
inline

Clear the document content.

const std::vector<DocumentTerm>& strus::analyzer::Document::forwardIndexTerms ( ) const
inline

Get the list of the forward index terms defined in this document.

const std::vector<DocumentMetaData>& strus::analyzer::Document::metadata ( ) const
inline

Get the list of the metadata defined in this document.

const std::vector<DocumentTerm>& strus::analyzer::Document::searchIndexTerms ( ) const
inline

Get the list of the search index terms defined in this document.

void strus::analyzer::Document::setAttribute ( const std::string &  t,
const std::string &  v 
)
inline

Define an attribute of the document.

void strus::analyzer::Document::setMetaData ( const std::string &  t,
const NumericVariant &  v 
)
inline

Define a meta data element of the document.

Parameters
[in]tname of the meta data element
[in]vvalue of the meta data element
void strus::analyzer::Document::setSubDocumentTypeName ( const std::string &  n)
inline

Set the name of the sub document type as declared in the document analyzer (empty for the main document)

const std::string& strus::analyzer::Document::subDocumentTypeName ( ) const
inline

Get the sub document type name.

void strus::analyzer::Document::swap ( Document o)
inline

Swap a document structure with another.


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