MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / insert

Method insert

common/peg-parser.cpp:131–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129 }
130
131 void insert(const std::string & word) {
132 size_t current = 0;
133 size_t pos = 0;
134 while (pos < word.length()) {
135 auto result = common_parse_utf8_codepoint(word, pos);
136 if (result.status != utf8_parse_result::SUCCESS) {
137 break;
138 }
139
140 uint32_t ch = result.codepoint;
141 pos += result.bytes_consumed;
142
143 auto it = nodes[current].children.find(ch);
144 if (it == nodes[current].children.end()) {
145 size_t child = create_node();
146 nodes[current].children[ch] = child;
147 current = child;
148 } else {
149 current = it->second;
150 }
151 }
152 nodes[current].is_word = true;
153 }
154};
155
156static std::pair<uint32_t, size_t> parse_hex_escape(const std::string & str, size_t pos, int hex_count) {

Callers 15

common_params_parse_exFunction · 0.45
common_params_to_mapFunction · 0.45
common_params_fit_implFunction · 0.45
common_init_resultMethod · 0.45
operator()Method · 0.45

Calls 4

lengthMethod · 0.80
findMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected