RED-6009: Document Tree Structure
* pmd fixes
This commit is contained in:
parent
8b7365c947
commit
57799c5f46
@ -121,14 +121,12 @@ public class SectionNodeFactory {
|
||||
private static void movePrecedingHeadlineToTableList(List<List<AbstractPageBlock>> splitList) {
|
||||
|
||||
for (int i = 0; i < splitList.size(); i++) {
|
||||
if (listIsTableOnly(splitList.get(i))) {
|
||||
if (i > 0) {
|
||||
List<AbstractPageBlock> previousList = splitList.get(i - 1);
|
||||
AbstractPageBlock lastPageBlockInPreviousList = previousList.get(previousList.size() - 1);
|
||||
if (pageBlockIsHeadline(lastPageBlockInPreviousList)) {
|
||||
previousList.remove(i - 1);
|
||||
splitList.get(i).add(0, lastPageBlockInPreviousList);
|
||||
}
|
||||
if (listIsTableOnly(splitList.get(i)) && i > 0) {
|
||||
List<AbstractPageBlock> previousList = splitList.get(i - 1);
|
||||
AbstractPageBlock lastPageBlockInPreviousList = previousList.get(previousList.size() - 1);
|
||||
if (pageBlockIsHeadline(lastPageBlockInPreviousList)) {
|
||||
previousList.remove(i - 1);
|
||||
splitList.get(i).add(0, lastPageBlockInPreviousList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ public class TableNodeFactory {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("PMD.UnusedPrivateMethod") // PMD actually flags this wrong
|
||||
private void addTableCell(Cell cell, int rowIndex, int colIndex, SemanticNode parentNode, int pageNumber, DocumentGraphFactory.Context context) {
|
||||
|
||||
PageNode page = context.getPage(pageNumber);
|
||||
|
||||
@ -15,7 +15,6 @@ import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.en
|
||||
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.entity.RedactionPosition;
|
||||
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.nodes.DocumentGraph;
|
||||
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.nodes.ImageNode;
|
||||
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.utils.RectangleTransformations;
|
||||
import com.iqser.red.service.redaction.v1.server.redaction.model.EntityType;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -126,7 +125,7 @@ public class RedactionLogCreatorService {
|
||||
.isHint(dictionaryService.isHint(image.getImageType().toString(), dossierTemplateId))
|
||||
.isDictionaryEntry(false)
|
||||
.isRecommendation(false)
|
||||
.positions(List.of(RectangleTransformations.toRectangle(image.getPosition(), image.getPage().getNumber())))
|
||||
.positions(List.of(toRectangle(image.getPosition(), image.getPage().getNumber())))
|
||||
.sectionNumber(image.getTocId().get(0))
|
||||
.section(image.getParent().buildTextBlock().getSearchText())
|
||||
.imageHasTransparency(image.isTransparent())
|
||||
|
||||
@ -3,9 +3,9 @@ package com.iqser.red.service.redaction.v1.server.redaction.utils;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Drools fucked up and introduced a bug with newer versions of java, this is needed or else:
|
||||
* Drools fucked up and introduced a bug with newer versions of java, use this class instead of java.util.List.of(e1, e2) or else.
|
||||
* java.lang.IncompatibleClassChangeError: Method 'java.util.List java.util.List.of(java.lang.Object, java.lang.Object)' must be InterfaceMethodref constant
|
||||
* Will be thrown on LHS of rules
|
||||
* Will be thrown on LHS of rules, but only sometimes, I was not able to recreate this bug in a different project.
|
||||
*/
|
||||
public class Liszt {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user