DM-165: Updated documine rules

This commit is contained in:
deiflaender 2023-08-07 13:38:19 +02:00
parent bfc8e16c94
commit 12fcc6ca6d

View File

@ -63,7 +63,7 @@ query "getFileAttributes"
rule "H.0.0 retract table of contents page"
when
$page: Page(getMainBodyTextBlock().getSearchText().contains("........") || (getMainBodyTextBlock().getSearchText().contains("APPENDICES") && getMainBodyTextBlock().getSearchText().contains("TABLES")))
$node: SemanticNode(onPage($page.getNumber()), !onPage($page.getNumber() -1))
$node: SemanticNode(onPage($page.getNumber()), !onPage($page.getNumber() -1), getType() != NodeType.IMAGE)
then
retract($node);
end
@ -77,13 +77,13 @@ rule "H.0.0: Ignore Table of Contents"
then
$tocHeadline.getParent().getPages()
.forEach(page -> page.getMainBody().stream()
.filter(node -> !node.getType().equals(NodeType.IMAGE))
.filter(node -> node.getPages().stream().noneMatch(nodePage -> nodePage.getNumber() < page.getNumber()))
.forEach(node -> retract(node))
);
end
// Rule unit: MAN.0
rule "H.0.0: Show headlines"
when
@ -914,8 +914,8 @@ rule "DOC.25.0: Results and Conclusion (406, 428, 438, 439, 474 & 487)"
when
FileAttribute(label == "OECD Number", valueEqualsAnyOf("406","428","438","439","474","487"))
$parentHeadline: Headline(
containsAnyStringIgnoreCase("Results", "Conclusion"),
!containsAnyString("POSITIVE CONTROL", "Positive Control", "Evaluation", "Micronucleus", "TABLE", "DISCUSSION", "CONCLUSIONS", "Interpretation","Viability"),
containsAnyString("Results", "Conclusion"),
!containsAnyString("POSITIVE CONTROL", "Positive Control", "Evaluation", "Micronucleus", "TABLE", "DISCUSSION", "CONCLUSIONS", "Interpretation","Viability", "analysis"),
$sectionIdentifier: getSectionIdentifier()
)
not Headline(getSectionIdentifier().isChildOf($sectionIdentifier))
@ -929,8 +929,8 @@ rule "DOC.25.1: Results and Conclusion (406, 428, 438, 439, 474 & 487)"
when
FileAttribute(label == "OECD Number", valueEqualsAnyOf("406","428","438","439","474","487"))
Headline(
containsAnyStringIgnoreCase("Results", "Conclusion"),
!containsAnyString("POSITIVE CONTROL", "Positive Control", "Evaluation", "Micronucleus", "TABLE", "DISCUSSION", "CONCLUSIONS", "Interpretation","Viability"),
containsAnyString("Results", "Conclusion"),
!containsAnyString("POSITIVE CONTROL", "Positive Control", "Evaluation", "Micronucleus", "TABLE", "DISCUSSION", "CONCLUSIONS", "Interpretation","Viability", "analysis"),
$sectionIdentifier: getSectionIdentifier()
)
$headline: Headline(getSectionIdentifier().isChildOf($sectionIdentifier))