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

Function parse_token_index

src/semantic/semantic.c:1459–1466  ·  view source on GitHub ↗

Parse a decimal index string via strtol, returning CBM_NOT_FOUND on parse * failure. Centralizes the atoi-replacement pattern for token_map lookups. */

Source from the content-addressed store, hash-verified

1457/* Parse a decimal index string via strtol, returning CBM_NOT_FOUND on parse
1458 * failure. Centralizes the atoi-replacement pattern for token_map lookups. */
1459static int parse_token_index(const char *idx_str) {
1460 if (!idx_str) {
1461 return CBM_NOT_FOUND;
1462 }
1463 char *end = NULL;
1464 long parsed = strtol(idx_str, &end, BASE_DECIMAL);
1465 return (end != idx_str) ? (int)parsed : CBM_NOT_FOUND;
1466}
1467
1468float cbm_sem_corpus_idf(const cbm_sem_corpus_t *corpus, const char *token) {
1469 if (!corpus || !token || corpus->doc_count == 0) {

Callers 3

cbm_sem_corpus_idfFunction · 0.85
cbm_sem_corpus_ri_vecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected