MCPcopy Create free account
hub / github.com/antirez/ds4 / find_compsec_answer

Function find_compsec_answer

ds4_eval.c:2909–2925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2907 const char *q = p + nlen;
2908 while (*q && isspace((unsigned char)*q)) q++;
2909 if (*q == ':') last = (char *)p;
2910 }
2911 return last ? last : strcasestr_local(visible, "answer");
2912}
2913
2914/* True when the in-range capital at `letter` is the object of an explicit
2915 * rejection earlier on the same answer line -- "not B", "isn't B",
2916 * "rules out C", "eliminate E" -- so it is a distractor the model is
2917 * discarding, not its pick. This rewrites only the lexical "first valid
2918 * letter wins" default for clear elimination phrasing; the cue set is kept
2919 * small and high-precision on purpose, and there is no general
2920 * selection-vs-rejection sentence parsing (issue #321). It never looks before
2921 * `start` or across a newline, so "D, not B" still grades D: the pick is
2922 * reached and accepted before the rejected distractor is ever inspected. */
2923static bool mc_letter_is_negated(const char *start, const char *letter) {
2924 const char *p = letter;
2925 /* Step back over the gap to the previous word: spaces and light separating
2926 * punctuation only, and never across a line break. */
2927 while (p > start) {
2928 char c = p[-1];

Callers 1

find_case_answerFunction · 0.85

Calls 3

find_last_answer_markerFunction · 0.85
find_integer_answerFunction · 0.85

Tested by

no test coverage detected