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

Function split_str

ctcdecode/ctcdecode/src/decoder_utils.cpp:102–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102std::vector<std::string> split_str(const std::string &s,
103 const std::string &delim) {
104 std::vector<std::string> result;
105 std::size_t start = 0, delim_len = delim.size();
106 while (true) {
107 std::size_t end = s.find(delim, start);
108 if (end == std::string::npos) {
109 if (start < s.size()) {
110 result.push_back(s.substr(start));
111 }
112 break;
113 }
114 if (end > start) {
115 result.push_back(s.substr(start, end - start));
116 }
117 start = end + delim_len;
118 }
119 return result;
120}
121
122bool prefix_compare(const PathTrie *x, const PathTrie *y) {
123 if (x->score == y->score) {

Callers 1

split_labelsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected