(answer: string, given: string)
| 95 | /** Names an answer uses that the request it was given does not contain: written in |
| 96 | * backticks or shaped like an identifier (flake8, json_agg_helper). Shown under the answer (K12). */ |
| 97 | export function namesNotIn(answer: string, given: string): string[] { |
| 98 | const named = [...answer.matchAll(/`([^`\n]+)`/g)].map(match => match[1].trim()).concat(answer.replace(/`[^`]*`/g, ' ').match(IDENTIFIER) ?? []); |
| 99 | const known = nameCheck(given); |
| 100 | return [...new Set(named.filter(name => name && nameLike(name) && !known(name)))]; |
| 101 | } |
| 102 | |
| 103 | /** Why the model's sentence was left out, as the sentence wrote it: a claim word the source does |
| 104 | * not show ("output", "Array") or a name in neither the source nor the facts. The note under the |
no test coverage detected