in opennlp-models-test/src/main/java/org/apache/opennlp/ModelValidator.java [80:93]
private static List<Path> getAvailableModelJars(String pattern, Path testDir, Path projectDir) {
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())
.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);
}
}