highlighter application  1.1
HCE project utils : highlighter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
HighlightingAlgorithmRefine.hpp
Go to the documentation of this file.
1 
14 #ifndef HIGHLIGHTING_ALGORITHM_REFINE_HPP
15 #define HIGHLIGHTING_ALGORITHM_REFINE_HPP
16 
17 #include "CRC64.h"
18 #include "CWords.hpp"
19 #include "InDataRefine.hpp"
21 #include "NotStricktChain.hpp"
22 #include "OutDataRefine.hpp"
23 #include "Refine.hpp"
24 
26 {
27  private:
28  unsigned char subjectMask;
29  unsigned int incrementalIndex;
31  std::map<unsigned int, std::pair<unsigned long long, WordPos> > wordPositionMap;
32  std::string name;
33  protected:
34  void setWordPositionMap(std::map<unsigned int, std::pair<unsigned long long, WordPos> > &_wordPositionMap);
35  void fillWordOffsetMap(Poco::SharedPtr<HCE::OutDataRefine> outData, SearchType searchType,
36  std::map<unsigned long long, std::vector<WordPos> > &wordMapPtr, std::map<unsigned int, WordPos> &wordOffsetMap);
37  void findChain(Poco::SharedPtr<HCE::OutDataRefine> outData, std::map<unsigned int, WordPos> &wordOffsetMap);
38  void findChainStrict(Poco::SharedPtr<HCE::OutDataRefine> outData, std::map<unsigned int, WordPos> &wordOffsetMap);
39  void joinBySegmentId(std::map<unsigned int, WordPos> &wordOffsetMap);
40  public:
41  HighlightingAlgorithmRefine():subjectMask(0), incrementalIndex(0), name("(A-HCE::Refine)") {}
42  HighlightingAlgorithmRefine(unsigned char _normalizationId, unsigned char _subjectMask): subjectMask(_subjectMask), incrementalIndex(0), name("(A-HCE::Refine)") {}
43  virtual void process(const std::vector<std::pair<SearchType, std::string> > &searchStrings, const Poco::SharedPtr<std::string> contentPtr,
44  ContentsStorageBase::WordPosPtrType wordMapPtr, std::map<unsigned int, WordPos> &wordOffsetMap);
45  virtual std::string getName() {return name;}
47 };
48 
49 #endif