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

Function find_case_answer

ds4_eval.c:2977–2988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2975
2976 char *answer = find_last_answer_marker(visible);
2977 if (answer) {
2978 const char *end = answer + strlen(answer);
2979 if (strlen(answer) > 96) end = answer + 96;
2980 for (const char *p = answer; p < end && *p; p++) {
2981 char c = (char)toupper((unsigned char)*p);
2982 if (c >= 'A' && c <= max_answer) {
2983 char before = p == visible ? ' ' : p[-1];
2984 char after = p[1];
2985 if (!is_letter_boundary(before, after)) continue;
2986 /* A standalone capital that begins a same-line English word
2987 * ("A careful ...") or a contraction ("I'll ...") is prose,
2988 * not the model's pick: the real letter comes later on the
2989 * line. Skip it; the reverse scan below still recovers it if
2990 * it was the only candidate (e.g. "Answer: A is correct"). */
2991 if (after == '\'') continue;

Callers 3

regrade_case_outcomeFunction · 0.85
extractor_self_test_caseFunction · 0.85
run_one_caseFunction · 0.85

Calls 6

find_answer_letterFunction · 0.85
eval_case_nchoicesFunction · 0.85
eval_case_is_compsecFunction · 0.85
find_compsec_answerFunction · 0.85
find_integer_answerFunction · 0.85

Tested by

no test coverage detected