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

Function normalize_text_as_paragraph

app/workflow/workflow.cpp:185–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183 throw std::runtime_error("failed to open workflow batch text file: " + path.string());
184 }
185 std::ostringstream raw;
186 raw << input.rdbuf();
187 return raw.str();
188}
189
190std::string normalize_text_as_paragraph(const std::string & text) {
191 std::string normalized;
192 bool in_space = false;
193 for (unsigned char ch : text) {
194 if (std::isspace(ch) != 0) {
195 in_space = !normalized.empty();
196 continue;
197 }
198 if (in_space) {
199 normalized.push_back(' ');
200 in_space = false;
201 }
202 normalized.push_back(static_cast<char>(ch));
203 }

Callers 1

read_batch_text_payloadFunction · 0.70

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected