MCPcopy Create free account
hub / github.com/binbinjiang/CVT-SLR / get_utf8_str_len

Function get_utf8_str_len

ctcdecode/ctcdecode/src/decoder_utils.cpp:75–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75size_t get_utf8_str_len(const std::string &str) {
76 size_t str_len = 0;
77 for (char c : str) {
78 str_len += ((c & 0xc0) != 0x80);
79 }
80 return str_len;
81}
82
83std::vector<std::string> split_utf8_str(const std::string &str) {
84 std::vector<std::string> result;

Callers 1

load_lmMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected