13 #include <Poco/UTF8String.h>
23 if(contentPtr.isNull() || contentPtr->empty())
27 unsigned int fakePosition = 0;
30 const std::string lowerCaseContent = Poco::UTF8::toLower(*contentPtr);
32 for(
unsigned int i = 0; i < searchStrings.size(); i++)
35 const std::string lowerCaseSearchString = Poco::UTF8::toLower(searchStrings[i].second);
36 while((findPos = lowerCaseContent.find(lowerCaseSearchString, findPos)) != std::string::npos)
38 fakePosition =
static_cast<unsigned int>(findPos);
39 auto it = wordOffsetMap.find(fakePosition);
40 if(it != wordOffsetMap.end())
42 if(((*it).second.endOffset - (*it).second.beginOffset) < lowerCaseSearchString.length())
44 (*it).second.endOffset = ((*it).second.beginOffset + lowerCaseSearchString.length());
50 localWpos.
endOffset = fakePosition + lowerCaseSearchString.length();
53 wordOffsetMap.insert(std::pair<unsigned int, WordPos>(fakePosition, localWpos));
56 if(wordOffsetMap.size() == maxNumber)
61 if(wordOffsetMap.size() == maxNumber)