MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / SplitValues

Function SplitValues

data/dictionary/DictionaryVariantRevPhrasesTest.cpp:24–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace {
23
24std::vector<std::string> SplitValues(const std::string& values) {
25 std::vector<std::string> split;
26 size_t start = 0;
27 while (start <= values.size()) {
28 const size_t end = values.find(' ', start);
29 split.push_back(values.substr(start, end - start));
30 if (end == std::string::npos) {
31 break;
32 }
33 start = end + 1;
34 }
35 return split;
36}
37
38bool IsDictionaryEntry(const std::string& line) {
39 return !line.empty() && line[0] != '#';

Callers 5

LoadMultiVariantSetsFunction · 0.70
LoadPreferredValuesFunction · 0.70
LoadIdentityPhraseKeysFunction · 0.70

Calls 4

findMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected