fix: prevent heuristic split on final English-only fragment
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+11
-6
@@ -4565,12 +4565,17 @@ body {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No allergen code found!
|
// No allergen code found!
|
||||||
// If it's not the last part (or even if it is, but we highly suspect merged languages),
|
// If this is the last fragment, it contains only the English text of the final course.
|
||||||
// we use the heuristic to find the hidden split-point.
|
// It should not be split again.
|
||||||
const split = heuristicSplitEnDe(fragment);
|
if (i === parts.length - 1) {
|
||||||
enParts.push(split.enPart);
|
enParts.push(fragment);
|
||||||
if (split.nextDe) {
|
} else {
|
||||||
deParts.push(split.nextDe);
|
// We use the heuristic to find the hidden split-point.
|
||||||
|
const split = heuristicSplitEnDe(fragment);
|
||||||
|
enParts.push(split.enPart);
|
||||||
|
if (split.nextDe) {
|
||||||
|
deParts.push(split.nextDe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-6
@@ -2524,12 +2524,17 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No allergen code found!
|
// No allergen code found!
|
||||||
// If it's not the last part (or even if it is, but we highly suspect merged languages),
|
// If this is the last fragment, it contains only the English text of the final course.
|
||||||
// we use the heuristic to find the hidden split-point.
|
// It should not be split again.
|
||||||
const split = heuristicSplitEnDe(fragment);
|
if (i === parts.length - 1) {
|
||||||
enParts.push(split.enPart);
|
enParts.push(fragment);
|
||||||
if (split.nextDe) {
|
} else {
|
||||||
deParts.push(split.nextDe);
|
// We use the heuristic to find the hidden split-point.
|
||||||
|
const split = heuristicSplitEnDe(fragment);
|
||||||
|
enParts.push(split.enPart);
|
||||||
|
if (split.nextDe) {
|
||||||
|
deParts.push(split.nextDe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user