a lot of stuff related to ocr/ofd method

This commit is contained in:
2024-11-22 23:19:04 +03:00
parent 02e4465075
commit 2b9ad2fcae
95 changed files with 57786 additions and 112 deletions

View File

@@ -28,3 +28,17 @@ bool vector_contains_element(const std::vector<T>& vector, const T& to_find) {
//ужас
template bool vector_contains_element<std::string>(const std::vector<std::string>& vector, const std::string& to_find);
std::vector<std::string> split(std::string s, std::string delimiter) {
std::vector<std::string> result;
size_t pos = 0;
std::string token;
while ((pos = s.find(delimiter)) != std::string::npos) {
token = s.substr(0, pos);
result.push_back(token);
s.erase(0, pos + delimiter.length());
}
result.push_back(s);
return result;
}

View File

@@ -12,4 +12,6 @@ std::string get_path_relative_to_home(std::string path);
template <typename T>
bool vector_contains_element(const std::vector<T> &vector, const T &to_find);
std::vector<std::string> split(std::string, std::string);
#endif // UTILS_H