| 491 | } |
| 492 | |
| 493 | std::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 | |
| 511 | std::vector<uint32_t> normalize_for_cer(const std::string & text) { |
| 512 | std::vector<uint32_t> out; |
no test coverage detected