This is an automated email from the ASF dual-hosted git repository.
mawiesne pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opennlp.git
The following commit(s) were added to refs/heads/main by this push:
new 9c419b8a OPENNLP-1775: Update Uimaj to 3.6.1 (#867)
9c419b8a is described below
commit 9c419b8a7c27f4b32c62602369da731a3b97afff
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Mon Oct 6 11:43:59 2025 +0200
OPENNLP-1775: Update Uimaj to 3.6.1 (#867)
* Bump org.apache.uima:uimaj-core from 3.6.0 to 3.6.1
Bumps org.apache.uima:uimaj-core from 3.6.0 to 3.6.1.
---
updated-dependencies:
- dependency-name: org.apache.uima:uimaj-core
dependency-version: 3.6.1
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
* OPENNLP-1775: Update Uimaj to 3.6.1
- fixes DictionaryResourceTest xml config to work with latest UimaJ release
---------
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot]
<49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Wiesner <[email protected]>
---
.../src/test/java/opennlp/uima/AbstractUimaTest.java | 14 ++++++++++----
.../opennlp/uima/dictionary/DictionaryResourceTest.java | 12 ++++++++----
.../resources/test-descriptors/DictionaryNameFinder.xml | 2 +-
opennlp-extensions/pom.xml | 2 +-
4 files changed, 20 insertions(+), 10 deletions(-)
diff --git
a/opennlp-extensions/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java
b/opennlp-extensions/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java
index 709a7f81..ad05b717 100644
---
a/opennlp-extensions/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java
+++
b/opennlp-extensions/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java
@@ -60,13 +60,19 @@ public abstract class AbstractUimaTest extends AbstractTest
{
for (ExternalResourceDescription modelDesc : resources) {
ResourceSpecifier resourceSpec = modelDesc.getResourceSpecifier();
String genericValue =
resourceSpec.getAttributeValue(FILE_URL).toString();
- String modelName = genericValue.split(":")[1]; // always right of
'file:' -> idx 1
+ final boolean isDictionary = genericValue.endsWith(".dic");
+ String resourceName;
+ if (genericValue != null && !isDictionary) {
+ resourceName = genericValue.split(":")[1]; // always right of 'file:'
-> idx 1
+ } else {
+ resourceName = genericValue;
+ }
try {
- if ("dictionary.dic".equals(modelName)) {
- URL fileURL = Paths.get(TARGET_DIR, modelName).toUri().toURL();
+ if (isDictionary) {
+ URL fileURL = Paths.get(TARGET_DIR, resourceName).toUri().toURL();
resourceSpec.setAttributeValue(FILE_URL, fileURL.toExternalForm());
} else {
- URL modelURL = OPENNLP_DIR.resolve(modelName).toUri().toURL();
+ URL modelURL = OPENNLP_DIR.resolve(resourceName).toUri().toURL();
resourceSpec.setAttributeValue(FILE_URL, modelURL.toExternalForm());
}
} catch (MalformedURLException e) {
diff --git
a/opennlp-extensions/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
b/opennlp-extensions/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
index a5d6956c..bcc1346e 100644
---
a/opennlp-extensions/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
+++
b/opennlp-extensions/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
@@ -43,6 +43,8 @@ import opennlp.tools.util.StringList;
import opennlp.uima.AbstractTest;
import opennlp.uima.util.CasUtil;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
public class DictionaryResourceTest extends AbstractTest {
private static AnalysisEngine AE;
@@ -54,15 +56,17 @@ public class DictionaryResourceTest extends AbstractTest {
@AfterAll
public static void afterClass() {
- AE.destroy(); // is this necessary?
+ if (AE != null) {
+ AE.destroy(); // is this necessary?
+ }
}
private static AnalysisEngine produceAE(String descName)
throws IOException, InvalidXMLException, ResourceInitializationException
{
File descFile = new File(PATH_DESCRIPTORS + "/" + descName);
XMLInputSource in = new XMLInputSource(descFile);
- ResourceSpecifier specifier = UIMAFramework.getXMLParser()
- .parseResourceSpecifier(in);
+ ResourceSpecifier specifier =
UIMAFramework.getXMLParser().parseResourceSpecifier(in);
+ assertNotNull(specifier);
return UIMAFramework.produceAnalysisEngine(specifier);
}
@@ -73,7 +77,7 @@ public class DictionaryResourceTest extends AbstractTest {
final DictionaryResource dic = (DictionaryResource)
AE.getResourceManager()
.getResource("/opennlp.uima.Dictionary");
final Dictionary d = dic.getDictionary();
- Assertions.assertNotNull(d);
+ assertNotNull(d);
Assertions.assertEquals(6, d.asStringSet().size(),
"There should be six entries in the dictionary");
Assertions.assertTrue(d.contains(new StringList("London")),
diff --git
a/opennlp-extensions/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml
b/opennlp-extensions/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml
index a4c91067..d0701700 100644
---
a/opennlp-extensions/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml
+++
b/opennlp-extensions/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml
@@ -108,7 +108,7 @@
<name>NameFinderDictionary</name>
<description/>
<fileResourceSpecifier>
- <fileUrl>file:dictionary.dic</fileUrl>
+ <fileUrl>dictionary.dic</fileUrl>
</fileResourceSpecifier>
<implementationName>opennlp.uima.dictionary.DictionaryResourceImpl</implementationName>
</externalResource>
diff --git a/opennlp-extensions/pom.xml b/opennlp-extensions/pom.xml
index 5a142b76..3ebd80ba 100644
--- a/opennlp-extensions/pom.xml
+++ b/opennlp-extensions/pom.xml
@@ -35,7 +35,7 @@
<name>Apache OpenNLP :: Extensions</name>
<properties>
- <uimaj.version>3.6.0</uimaj.version>
+ <uimaj.version>3.6.1</uimaj.version>
<morfologik.version>2.1.9</morfologik.version>
</properties>