(side: Side, name: string | undefined)
| 116 | const sides = new Set<Side>(); |
| 117 | let subject: string | undefined, named = false; |
| 118 | const take = (side: Side, name: string | undefined): void => { |
| 119 | const word = name?.replace(/[.:/]+$/, ''); |
| 120 | if (!word || NOT_A_NAME.has(word.toLowerCase())) return; |
| 121 | sides.add(side); |
| 122 | if (!SELF.has(word.toLowerCase()) && !subject) subject = word; |
| 123 | named = true; |
| 124 | }; |
| 125 | for (const phrasing of PHRASINGS) take(phrasing.side, phrasing.pattern.exec(prompt)?.[1]); |
| 126 | const which = WHICH_CALLS.exec(prompt); |
| 127 | if (which) take(which[1].toLowerCase() === 'welche' && /(?:en|[^s]s)$/iu.test(which[2]) ? 'outgoing' : 'incoming', which[3]); |
no outgoing calls
no test coverage detected