diff --git a/frontend/src/views/social/VocabLessonView.vue b/frontend/src/views/social/VocabLessonView.vue index bf43d22..1001694 100644 --- a/frontend/src/views/social/VocabLessonView.vue +++ b/frontend/src/views/social/VocabLessonView.vue @@ -2285,13 +2285,20 @@ export default { answers.forEach((answer, index) => { if (answer && answer.trim()) { const nativeWord = nativeWords[index]; - if (nativeWord && nativeWord.trim() && nativeWord !== answer) { + const nativeText = String(nativeWord || '').trim(); + const answerText = String(answer || '').trim(); + const nativeWordCount = nativeText.split(/\s+/).filter(Boolean).length; + const answerWordCount = answerText.split(/\s+/).filter(Boolean).length; + const nativeLooksSentence = /[?.!]/.test(nativeText) || nativeWordCount >= 4; + const answerLooksShortToken = answerWordCount <= 2; + const likelyFragmentMismatch = nativeLooksSentence && answerLooksShortToken; + if (nativeText && answerText && nativeText !== answerText && !likelyFragmentMismatch) { // Die answer ist normalerweise Bisaya, nativeWord ist Muttersprache // Nur hinzufügen, wenn sie unterschiedlich sind (verhindert "ko" -> "ko") - vocabMap.set(`${nativeWord}-${answer}`, { learning: nativeWord, reference: answer }); - debugLog(`[importantVocab] Gap Fill extrahiert - Muttersprache:`, nativeWord, `Bisaya:`, answer); + vocabMap.set(`${nativeText}-${answerText}`, { learning: nativeText, reference: answerText }); + debugLog(`[importantVocab] Gap Fill extrahiert - Muttersprache:`, nativeText, `Bisaya:`, answerText); } else { - debugLog(`[importantVocab] Gap Fill übersprungen - keine Muttersprache oder gleich:`, nativeWord, answer); + debugLog(`[importantVocab] Gap Fill übersprungen - Satz/Fragment-Mismatch oder gleich:`, nativeText, answerText); } } });