| 100 | } |
| 101 | |
| 102 | std::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 | |
| 122 | bool prefix_compare(const PathTrie *x, const PathTrie *y) { |
| 123 | if (x->score == y->score) { |