NK92 - Search crawling
Do a Log for now.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "String.h"
|
||||
#include <iostream>
|
||||
#include <regex>
|
||||
#include <sstream>
|
||||
|
||||
namespace Nuake
|
||||
@@ -36,6 +37,18 @@ namespace Nuake
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string String::Sanitize(const std::string& keyword) {
|
||||
std::string sanitizedKeyword = keyword;
|
||||
|
||||
// Remove spaces, underscores, and hyphens using regex
|
||||
sanitizedKeyword = std::regex_replace(sanitizedKeyword, std::regex("[ _-]+"), "");
|
||||
|
||||
// Convert to lowercase
|
||||
std::transform(sanitizedKeyword.begin(), sanitizedKeyword.end(), sanitizedKeyword.begin(), ::tolower);
|
||||
|
||||
return sanitizedKeyword;
|
||||
}
|
||||
|
||||
std::vector<std::string> String::Split(const std::string& string, char delimiter)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
|
||||
Reference in New Issue
Block a user