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

Function parse_token_index

src/semantic/semantic.c:1433–1440  ·  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

1431/* Parse a decimal index string via strtol, returning CBM_NOT_FOUND on parse
1432 * failure. Centralizes the atoi-replacement pattern for token_map lookups. */
1433static int parse_token_index(const char *idx_str) {
1434 if (!idx_str) {
1435 return CBM_NOT_FOUND;
1436 }
1437 char *end = NULL;
1438 long parsed = strtol(idx_str, &end, BASE_DECIMAL);
1439 return (end != idx_str) ? (int)parsed : CBM_NOT_FOUND;
1440}
1441
1442float cbm_sem_corpus_idf(const cbm_sem_corpus_t *corpus, const char *token) {
1443 if (!corpus || !token || corpus->doc_count == 0) {

Callers 2

cbm_sem_corpus_idfFunction · 0.85
cbm_sem_corpus_ri_vecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected