MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / trim_spaces

Function trim_spaces

src/models/chatterbox/text_tokenizer.cpp:206–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206std::string trim_spaces(std::string value) {
207 auto is_space = [](unsigned char ch) { return std::isspace(ch) != 0; };
208 value.erase(value.begin(), std::find_if(value.begin(), value.end(), [&](char ch) { return !is_space(static_cast<unsigned char>(ch)); }));
209 value.erase(std::find_if(value.rbegin(), value.rend(), [&](char ch) { return !is_space(static_cast<unsigned char>(ch)); }).base(), value.end());
210 return value;
211}
212
213std::string decompose_korean_hangul(std::string_view text) {
214 std::string out;

Calls 3

eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected