This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opennlp-models.git

commit 413190b1efdad4e0247b704c7b740824adea525d
Author: Richard Zowalla <[email protected]>
AuthorDate: Mon Jun 24 08:21:00 2024 +0200

    Enhances code to filter source and javadoc jar files from model validation
---
 .../src/main/java/org/apache/opennlp/ModelValidator.java       | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/opennlp-models-test/src/main/java/org/apache/opennlp/ModelValidator.java 
b/opennlp-models-test/src/main/java/org/apache/opennlp/ModelValidator.java
index 060ed1c..6daeb23 100644
--- a/opennlp-models-test/src/main/java/org/apache/opennlp/ModelValidator.java
+++ b/opennlp-models-test/src/main/java/org/apache/opennlp/ModelValidator.java
@@ -81,10 +81,12 @@ public class ModelValidator {
     final Pattern regexPattern = Pattern.compile(pattern);
     try (Stream<Path> stream = Files.walk(projectDir)) {
       return stream
-          .filter(Files::isRegularFile)
-          .filter(path -> !path.startsWith(testDir))
-          .filter(path -> 
regexPattern.matcher(path.getFileName().toString()).matches())
-          .toList();
+              .filter(Files::isRegularFile)
+              .filter(path -> !path.startsWith(testDir))
+              .filter(path -> 
regexPattern.matcher(path.getFileName().toString()).matches())
+              .filter(path -> 
!path.getFileName().toString().contains("javadoc"))  // Exclude files 
containing "javadoc"
+              .filter(path -> 
!path.getFileName().toString().contains("source"))  // Exclude files containing 
"source"
+              .toList();
     } catch (IOException e) {
       throw new RuntimeException(e);
     }

Reply via email to