#include #include "level.hpp" namespace Nimbin { namespace Level { namespace Check { std::string normalize(const std::string& s) { std::string out; out.reserve(s.size()); bool last_space = true; for (char c : s) { if (std::isspace(static_cast(c))) { if (!last_space) { out += ' '; last_space = true; } } else { out += c; last_space = false; } } if (!out.empty() && out.back() == ' ') out.pop_back(); return out; } bool contains_Pattern(const std::string& haystack, const std::string& needle) { if (needle.empty()) return true; std::string norm_needle = normalize(needle); return haystack.find(norm_needle) != std::string::npos; } } // namespace Check } // namespace Level } // namespace Nimbin