DM-307: Added rules function to check if section has paragraphs #19
@ -86,4 +86,9 @@ public class Section implements GenericSemanticNode {
|
|||||||
.map(node -> (Headline) node).anyMatch(h -> h.containsStringIgnoreCase(value));
|
.map(node -> (Headline) node).anyMatch(h -> h.containsStringIgnoreCase(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean hasParagraphs(){
|
||||||
|
return streamAllSubNodesOfType(NodeType.PARAGRAPH).findFirst().isPresent();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ public class DocumineFloraTest extends AbstractRedactionIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void titleExtraction() throws IOException {
|
public void titleExtraction() throws IOException {
|
||||||
|
|
||||||
AnalyzeRequest request = uploadFileToStorage("files/Documine/Flora/A13617AV/402_F.3.1 - A13617AV - Acute Dermal Toxicity.pdf");
|
AnalyzeRequest request = uploadFileToStorage("files/Documine/Flora/A13617AV/474_G.1.2 - 1768300_MMNA_A13617AV_report.pdf");
|
||||||
System.out.println("Start Full integration test");
|
System.out.println("Start Full integration test");
|
||||||
analyzeService.analyzeDocumentStructure(new StructureAnalyzeRequest(request.getDossierId(), request.getFileId()));
|
analyzeService.analyzeDocumentStructure(new StructureAnalyzeRequest(request.getDossierId(), request.getFileId()));
|
||||||
System.out.println("Finished structure analysis");
|
System.out.println("Finished structure analysis");
|
||||||
|
|||||||
@ -874,6 +874,7 @@ rule "23: Bodyweight changes"
|
|||||||
)
|
)
|
||||||
&& !getHeadline().containsString("Appendix")
|
&& !getHeadline().containsString("Appendix")
|
||||||
&& !getHeadline().containsString("TABLE")
|
&& !getHeadline().containsString("TABLE")
|
||||||
|
&& hasParagraphs()
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
var entity = entityCreationService.byBoundary(Boundary.merge($section.streamAllSubNodesOfType(NodeType.PARAGRAPH).map(SemanticNode::getBoundary).toList()), "bodyweight_changes", EntityType.ENTITY, $section);
|
var entity = entityCreationService.byBoundary(Boundary.merge($section.streamAllSubNodesOfType(NodeType.PARAGRAPH).map(SemanticNode::getBoundary).toList()), "bodyweight_changes", EntityType.ENTITY, $section);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user