fix(vocab): reject lexical hints paired with sentences

This commit is contained in:
Torsten Schulz (local)
2026-08-27 12:25:43 +02:00
parent 9d0164aa0d
commit bb719b3c75
4 changed files with 37 additions and 3 deletions

View File

@@ -739,8 +739,13 @@ export default {
const rightLooksSentence = rightWords >= 3 || /[?!.].+\S/.test(rightText);
const leftLooksShortFragment = leftWords <= 1 && leftText.length <= 12;
const rightLooksShortFragment = rightWords <= 1 && rightText.length <= 12;
const leftLooksLexicalHint = /\//.test(leftText) && leftWords <= 2 && leftText.length <= 24;
const rightLooksLexicalHint = /\//.test(rightText) && rightWords <= 2 && rightText.length <= 24;
return (leftLooksShortFragment && rightLooksSentence) || (rightLooksShortFragment && leftLooksSentence);
return (leftLooksShortFragment && rightLooksSentence)
|| (rightLooksShortFragment && leftLooksSentence)
|| (leftLooksLexicalHint && rightLooksSentence)
|| (rightLooksLexicalHint && leftLooksSentence);
},
splitPhraseAlternatives(value) {
const text = String(value || '').trim();

View File

@@ -2320,8 +2320,13 @@ export default {
const rightLooksSentence = rightWords >= 3 || /[?!.].+\S/.test(rightText);
const leftLooksShortFragment = leftWords <= 1 && leftText.length <= 12;
const rightLooksShortFragment = rightWords <= 1 && rightText.length <= 12;
const leftLooksLexicalHint = /\//.test(leftText) && leftWords <= 2 && leftText.length <= 24;
const rightLooksLexicalHint = /\//.test(rightText) && rightWords <= 2 && rightText.length <= 24;
return (leftLooksShortFragment && rightLooksSentence) || (rightLooksShortFragment && leftLooksSentence);
return (leftLooksShortFragment && rightLooksSentence)
|| (rightLooksShortFragment && leftLooksSentence)
|| (leftLooksLexicalHint && rightLooksSentence)
|| (rightLooksLexicalHint && leftLooksSentence);
},
isTrainableLessonVocabPair(learning, reference) {
const l = String(learning || '').trim();