14 #include <Poco/RegularExpression.h>
27 if(searchStrings.size() > 0 && !contentPtr.isNull() && !contentPtr->empty())
29 Poco::RegularExpression::Match match;
30 unsigned int segmentId = 0;
31 for(
unsigned int i = 0; i < searchStrings.size(); i++)
33 if(!searchStrings[i].second.empty())
38 Poco::RegularExpression rexp(searchStrings[i].second, 0,
false);
40 while(match.offset != std::string::npos)
42 auto it = wordOffsetMap.find(match.offset);
43 if(it == wordOffsetMap.end())
45 wordOffsetMap.insert(std::pair<unsigned int, WordPos>(match.offset,
WordPos(match.offset, match.offset + match.length, match.offset, segmentId)));
47 else if(it->second.endOffset < (match.offset + match.length))
49 it->second.endOffset = (match.offset + match.length);
50 it->second.segmentId = segmentId;
57 catch(Poco::RegularExpressionException &excp)