Defines the context for inserting markups into one document.
More...
#include <segmenterMarkupContextInterface.hpp>
Defines the context for inserting markups into one document.
virtual strus::SegmenterMarkupContextInterface::~SegmenterMarkupContextInterface |
( |
| ) |
|
|
inlinevirtual |
virtual std::string strus::SegmenterMarkupContextInterface::getContent |
( |
| ) |
const |
|
pure virtual |
Get the original document content with all markups declared inserted.
- Returns
- the marked up document content
virtual bool strus::SegmenterMarkupContextInterface::getNext |
( |
SegmenterPosition & |
segpos, |
|
|
const char *& |
segment, |
|
|
std::size_t & |
segmentsize |
|
) |
| |
|
pure virtual |
Get the next content segment.
- Parameters
-
[out] | segpos | segment position returned |
[out] | segment | pointer to start of segment |
[out] | segmentsize | size of segment in bytes |
- Returns
- true, on success, false on eof or error
- Note
- this method allows to iterate on content segments for implementing markups covering multiple content segments
virtual void strus::SegmenterMarkupContextInterface::putAttribute |
( |
const SegmenterPosition & |
segpos, |
|
|
std::size_t |
ofs, |
|
|
const std::string & |
name, |
|
|
const std::string & |
value |
|
) |
| |
|
pure virtual |
Define an attribute markup in the text.
- Parameters
-
[in] | segpos | segment position |
[in] | ofs | offset ot the attribute in the text |
[in] | name | name of the attribute to insert (as UTF-8) |
[in] | value | of the attribute to insert (as UTF-8) |
virtual void strus::SegmenterMarkupContextInterface::putCloseTag |
( |
const SegmenterPosition & |
segpos, |
|
|
std::size_t |
ofs, |
|
|
const std::string & |
name |
|
) |
| |
|
pure virtual |
Define a close tag markup in the text.
- Parameters
-
[in] | segpos | segment position returned by the method getNext of the segmenter context created by the same instance as this and fed with the same content |
[in] | ofs | byte position offset of the parsed content (UTF-8) in the segment where we want to insert the markup into |
[in] | name | tag name closed to put as markup into the content (as UTF-8) |
virtual void strus::SegmenterMarkupContextInterface::putOpenTag |
( |
const SegmenterPosition & |
segpos, |
|
|
std::size_t |
ofs, |
|
|
const std::string & |
name |
|
) |
| |
|
pure virtual |
Define an open tag markup in the text.
- Parameters
-
[in] | segpos | segment position returned by the method getNext of the segmenter context created by the same instance as this and fed with the same content |
[in] | ofs | byte position offset of the parsed content (UTF-8) in the segment where we want to insert the markup into |
[in] | name | tag name to put as markup into the content (as UTF-8) |
virtual unsigned int strus::SegmenterMarkupContextInterface::segmentSize |
( |
const SegmenterPosition & |
segpos | ) |
|
|
pure virtual |
Get the size in bytes of a segment converted to UTF-8.
- Parameters
-
[in] | segpos | segment position |
- Returns
- the size of the segment as UTF-8 in bytes
virtual int strus::SegmenterMarkupContextInterface::tagLevel |
( |
const SegmenterPosition & |
segpos | ) |
const |
|
pure virtual |
Get the (tag) hierarchy level of a segment specified by its position in the original source.
- Parameters
-
[in] | segpos | segment position |
- Returns
- the (tag) hierarchy level of the segment
virtual std::string strus::SegmenterMarkupContextInterface::tagName |
( |
const SegmenterPosition & |
segpos | ) |
const |
|
pure virtual |
Get the (tag) name of a segment specified by its position in the original source.
- Parameters
-
[in] | segpos | segment position |
- Returns
- the (tag) name of the segment
The documentation for this class was generated from the following file: