Compare commits

...
Author SHA1 Message Date
Kilian Schuettler 85432a2511 RED-10714: fix IndexOutOfBoundsException
(cherry picked from commit 0b6a292c75)
2025-01-13 13:22:59 +01:00
@@ -71,6 +71,9 @@ public class TableOfContentsClassificationService {
private int identifyTOCItems(int start, List<TextBlockOnPage> textBlocks, ClassificationDocument document) {
if (start >= textBlocks.size()) {
return start;
}
ClassificationPage startPage = textBlocks.get(start).page();
List<TextBlockOnPage> initialLookAhead = textBlocks.subList(start, Math.min(start + SURROUNDING_BLOCKS_RADIUS, textBlocks.size()));
HashMap<NumberWord, TextBlockOnPage> numberToBlockLookup = new HashMap<>();