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

Function cbm_minhash_compute

src/simhash/minhash.c:268–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268bool cbm_minhash_compute(TSNode func_body, const char *source, int language, cbm_minhash_t *out) {
269 (void)source;
270 (void)language;
271
272 if (ts_node_is_null(func_body)) {
273 return false;
274 }
275
276 const char *tokens[MAX_TOKENS];
277 int token_count = collect_ast_tokens(func_body, tokens, MAX_TOKENS);
278 if (token_count < CBM_MINHASH_MIN_NODES) {
279 return false;
280 }
281
282 int unique_structural = hash_trigrams(tokens, token_count, out);
283 return unique_structural >= MIN_UNIQUE_TRIGRAMS;
284}
285
286/* ── Jaccard similarity ──────────────────────────────────────────── */
287

Callers 1

compute_fingerprintFunction · 0.85

Calls 2

collect_ast_tokensFunction · 0.85
hash_trigramsFunction · 0.85

Tested by

no test coverage detected