Merge branch 'RED-10714-bp' into 'release/0.188.x'
RED-10714: fix IndexOutOfBoundsException See merge request fforesight/layout-parser!261
This commit is contained in:
commit
c3de36cdf4
@ -69,6 +69,9 @@ public class TableOfContentsClassificationService {
|
|||||||
|
|
||||||
private int identifyTOCItems(int start, List<TextBlockOnPage> textBlocks, ClassificationDocument document) {
|
private int identifyTOCItems(int start, List<TextBlockOnPage> textBlocks, ClassificationDocument document) {
|
||||||
|
|
||||||
|
if (start >= textBlocks.size()) {
|
||||||
|
return start;
|
||||||
|
}
|
||||||
ClassificationPage startPage = textBlocks.get(start).page();
|
ClassificationPage startPage = textBlocks.get(start).page();
|
||||||
List<TextBlockOnPage> initialLookAhead = textBlocks.subList(start, Math.min(start + SURROUNDING_BLOCKS_RADIUS, textBlocks.size()));
|
List<TextBlockOnPage> initialLookAhead = textBlocks.subList(start, Math.min(start + SURROUNDING_BLOCKS_RADIUS, textBlocks.size()));
|
||||||
HashMap<Word, TextBlockOnPage> lookup = new HashMap<>();
|
HashMap<Word, TextBlockOnPage> lookup = new HashMap<>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user