strusAnalyzer  0.17
Public Member Functions | List of all members
strus::analyzer::Token Struct Reference

Structure describing a token in the document by its start and end position. More...

#include <token.hpp>

Inheritance diagram for strus::analyzer::Token:
strus::analyzer::PatternLexem

Public Member Functions

 Token ()
 Default constructor. More...
 
 Token (int ordpos_, const Position &origpos_, int origsize_)
 Constructor. More...
 
 Token (const Token &o)
 Copy constructor. More...
 
int ordpos () const
 Get the ordinal (counting) position in the document. This value is used to assign the term position, that is not the byte position but a number taken from the enumeration of all distinct feature byte postions. More...
 
const Positionorigpos () const
 Get the start position of this token in the original document. More...
 
Positionorigpos ()
 Get the start position of this token in the original document. More...
 
int origsize () const
 Get the byte size of the translated token string (UTF-8) in the original document segment. More...
 
void setOrigPosition (const Position &origpos_)
 Set the original segment index of the token in the source. More...
 
void setOrigSize (int origsize_)
 Set the original size of the token in the source. More...
 
void setOrdpos (int ordpos_)
 Set the ordinal position of the token in the source (adjusted in case of multiple segments) More...
 
int compare (const Token &o) const
 Compare with another token. More...
 
bool operator< (const Token &o) const
 Compare operator for sort. More...
 

Detailed Description

Structure describing a token in the document by its start and end position.

Constructor & Destructor Documentation

strus::analyzer::Token::Token ( )
inline

Default constructor.

strus::analyzer::Token::Token ( int  ordpos_,
const Position origpos_,
int  origsize_ 
)
inline

Constructor.

Parameters
[in]ordpos_oridinal term position assigned to the the token
[in]origpos_position of the token start in the original document
[in]origsize_size of the token in bytes in the translated document segment (UTF-8)
strus::analyzer::Token::Token ( const Token o)
inline

Copy constructor.

Member Function Documentation

int strus::analyzer::Token::compare ( const Token o) const
inline

Compare with another token.

bool strus::analyzer::Token::operator< ( const Token o) const
inline

Compare operator for sort.

int strus::analyzer::Token::ordpos ( ) const
inline

Get the ordinal (counting) position in the document. This value is used to assign the term position, that is not the byte position but a number taken from the enumeration of all distinct feature byte postions.

const Position& strus::analyzer::Token::origpos ( ) const
inline

Get the start position of this token in the original document.

Position& strus::analyzer::Token::origpos ( )
inline

Get the start position of this token in the original document.

int strus::analyzer::Token::origsize ( ) const
inline

Get the byte size of the translated token string (UTF-8) in the original document segment.

void strus::analyzer::Token::setOrdpos ( int  ordpos_)
inline

Set the ordinal position of the token in the source (adjusted in case of multiple segments)

Parameters
[in]ordpos_oridinal term position assigned to the the token
void strus::analyzer::Token::setOrigPosition ( const Position origpos_)
inline

Set the original segment index of the token in the source.

Parameters
[in]origpos_position of the token start in the original document
void strus::analyzer::Token::setOrigSize ( int  origsize_)
inline

Set the original size of the token in the source.

Parameters
[in]origsize_size of the token in bytes

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