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

Function is_camel

internal/cbm/doc_pdf.c:587–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587static bool is_camel(const uint32_t *t, int n) {
588 if (n < 3 || str_isupper(t, n) || str_islower(t, n)) {
589 return false;
590 }
591 /* [A-Z]{2,}s: PDFs, APIs, IDs */
592 if (t[n - 1] == 's') {
593 bool caps = true;
594 for (int i = 0; i < n - 1; i++) {
595 caps = caps && t[i] >= 'A' && t[i] <= 'Z';
596 }
597 if (caps) {
598 return false;
599 }
600 }
601 for (int i = 0; i + 1 < n; i++) {
602 uint32_t a = t[i];
603 uint32_t b = t[i + 1];
604 if (pdf_u_lower(a) && pdf_u_upper(b)) {
605 return true;
606 }
607 if (i >= 1 && pdf_u_upper(t[i - 1]) && pdf_u_upper(a) && pdf_u_lower(b)) {
608 return true;
609 }
610 }
611 return false;
612}
613
614/* The extension after the last '.' of a segment, when it is a code extension. */
615static bool has_code_ext(const uint32_t *s, int n) {

Callers 1

tok_candidateFunction · 0.85

Calls 4

str_isupperFunction · 0.85
str_islowerFunction · 0.85
pdf_u_lowerFunction · 0.85
pdf_u_upperFunction · 0.85

Tested by

no test coverage detected