MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / join_string

Function join_string

src/utils.cc:141–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139 }
140
141 std::string join_string(const std::vector<std::string>& tokens, const std::string& separator) {
142 std::string text;
143 for (const auto& token : tokens) {
144 if (!text.empty())
145 text += separator;
146 text += token;
147 }
148 return text;
149 }
150
151 std::vector<std::string> split_tokens(const std::string& text) {
152 return split_string(text, " ");

Callers 2

join_tokensFunction · 0.85
TEST_PFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by 1

TEST_PFunction · 0.68