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