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

Function normalize_for_wer

src/models/miotts/session.cpp:493–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493std::vector<std::string> normalize_for_wer(const std::string & text) {
494 const auto lowered = lowercase_ascii(text);
495 std::vector<std::string> words;
496 std::string current;
497 for (const unsigned char ch : lowered) {
498 if (is_ascii_alnum_or_apostrophe(ch)) {
499 current.push_back(static_cast<char>(ch));
500 } else if (!current.empty()) {
501 words.push_back(std::move(current));
502 current.clear();
503 }
504 }
505 if (!current.empty()) {
506 words.push_back(std::move(current));
507 }
508 return words;
509}
510
511std::vector<uint32_t> normalize_for_cer(const std::string & text) {
512 std::vector<uint32_t> out;

Callers 1

asr_errorFunction · 0.85

Calls 4

lowercase_asciiFunction · 0.70
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected