MCPcopy Create free account
hub / github.com/comaps/comaps / PreprocessBeforeTokenization

Function PreprocessBeforeTokenization

libs/indexer/search_string_utils.cpp:257–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257void PreprocessBeforeTokenization(UniString & query)
258{
259 search::Delimiters const delims;
260
261 for (auto const & replacement : kPreprocessReplacements)
262 {
263 auto start = query.begin();
264 while ((start = std::search(start, query.end(), replacement.first.begin(), replacement.first.end())) != query.end())
265 {
266 auto end = start + replacement.first.size();
267 if ((start == query.begin() || delims(*(start - 1))) && (end == query.end() || delims(*end)))
268 {
269 auto const dist = std::distance(query.begin(), start);
270 query.Replace(start, end, replacement.second.begin(), replacement.second.end());
271 start = query.begin() + dist;
272 }
273 start += 1;
274 }
275 }
276}
277
278UniString FeatureTypeToString(uint32_t type)
279{

Callers 2

SetQueryMethod · 0.85
operator()Method · 0.85

Calls 6

searchFunction · 0.85
distanceFunction · 0.85
ReplaceMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected