strusAnalyzer  0.17
segmenterMarkupContextInterface.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_ANALYZER_SEGMENTER_MARKUP_CONTEXT_INTERFACE_HPP_INCLUDED
11 #define _STRUS_ANALYZER_SEGMENTER_MARKUP_CONTEXT_INTERFACE_HPP_INCLUDED
13 #include <string>
14 
16 namespace strus
17 {
18 
22 {
23 public:
26 
33  virtual bool getNext( SegmenterPosition& segpos, const char*& segment, std::size_t& segmentsize)=0;
34 
38  virtual unsigned int segmentSize( const SegmenterPosition& segpos)=0;
39 
43  virtual std::string tagName( const SegmenterPosition& segpos) const=0;
44 
48  virtual int tagLevel( const SegmenterPosition& segpos) const=0;
49 
54  virtual void putOpenTag(
55  const SegmenterPosition& segpos,
56  std::size_t ofs,
57  const std::string& name)=0;
58 
64  virtual void putAttribute(
65  const SegmenterPosition& segpos,
66  std::size_t ofs,
67  const std::string& name,
68  const std::string& value)=0;
69 
74  virtual void putCloseTag(
75  const SegmenterPosition& segpos,
76  std::size_t ofs,
77  const std::string& name)=0;
78 
81  virtual std::string getContent() const=0;
82 };
83 
84 }//namespace
85 #endif
86 
int SegmenterPosition
Position of a segment in the original source.
Definition: segmenterContextInterface.hpp:20
virtual void putOpenTag(const SegmenterPosition &segpos, std::size_t ofs, const std::string &name)=0
Define an open tag markup in the text.
virtual unsigned int segmentSize(const SegmenterPosition &segpos)=0
Get the size in bytes of a segment converted to UTF-8.
virtual void putCloseTag(const SegmenterPosition &segpos, std::size_t ofs, const std::string &name)=0
Define a close tag markup in the text.
virtual std::string getContent() const =0
Get the original document content with all markups declared inserted.
virtual void putAttribute(const SegmenterPosition &segpos, std::size_t ofs, const std::string &name, const std::string &value)=0
Define an attribute markup in the text.
virtual ~SegmenterMarkupContextInterface()
Destructor.
Definition: segmenterMarkupContextInterface.hpp:25
Interface for the execution context of a document segmenter.
Defines the context for inserting markups into one document.
Definition: segmenterMarkupContextInterface.hpp:21
virtual int tagLevel(const SegmenterPosition &segpos) const =0
Get the (tag) hierarchy level of a segment specified by its position in the original source...
virtual bool getNext(SegmenterPosition &segpos, const char *&segment, std::size_t &segmentsize)=0
Get the next content segment.
virtual std::string tagName(const SegmenterPosition &segpos) const =0
Get the (tag) name of a segment specified by its position in the original source. ...