MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_minhash_compute

Function cbm_minhash_compute

src/simhash/minhash.c:249–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249bool cbm_minhash_compute(TSNode func_body, const char *source, int language, cbm_minhash_t *out) {
250 (void)source;
251 (void)language;
252
253 if (ts_node_is_null(func_body)) {
254 return false;
255 }
256
257 const char *tokens[MAX_TOKENS];
258 int token_count = collect_ast_tokens(func_body, tokens, MAX_TOKENS);
259 if (token_count < CBM_MINHASH_MIN_NODES) {
260 return false;
261 }
262
263 int unique_structural = hash_trigrams(tokens, token_count, out);
264 return unique_structural >= MIN_UNIQUE_TRIGRAMS;
265}
266
267/* ── Jaccard similarity ──────────────────────────────────────────── */
268

Callers 1

compute_fingerprintFunction · 0.85

Calls 2

collect_ast_tokensFunction · 0.85
hash_trigramsFunction · 0.85

Tested by

no test coverage detected