Skip to content

Commit

Permalink
Merge pull request #433 from ThomasGinter/issues/432
Browse files Browse the repository at this point in the history
Updated the UIMA and UimaFit dependencies to match the latest version
  • Loading branch information
reckart authored Oct 13, 2020
2 parents 829659c + 64097d7 commit 6f84cf0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,12 @@
*/
package org.cleartk.stanford.corenlp;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import org.apache.uima.analysis_engine.AnalysisEngine;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.testing.factory.TokenBuilder;
import org.apache.uima.fit.util.JCasUtil;
import org.cleartk.ne.type.NamedEntity;
import org.cleartk.ne.type.NamedEntityMention;
import org.cleartk.stanford.corenlp.StanfordCoreNlpAnnotator;
import org.cleartk.syntax.constituent.type.TopTreebankNode;
import org.cleartk.syntax.constituent.type.TreebankNode;
import org.cleartk.syntax.dependency.type.DependencyNode;
Expand All @@ -42,6 +35,8 @@
import org.junit.Before;
import org.junit.Test;

import java.util.*;

/**
*
* <br>
Expand Down Expand Up @@ -237,13 +232,14 @@ public void test() throws Throwable {
// expectedEntities.add(Arrays.asList("Stanford-based"));
// expectedEntities.add(Arrays.asList("milk", "it", "the milk"));
// expectedEntities.add(Arrays.asList("Martha", "she", "her"));
expectedEntities.add(Arrays.asList("The Stanford-based Dr. Smith", "him"));

expectedEntities.add(Arrays.asList("Stanford-based", "she", "her"));
expectedEntities.add(Arrays.asList("Smith"));
expectedEntities.add(Arrays.asList("Martha"));
expectedEntities.add(Arrays.asList("The Stanford-based Dr. Smith", "him"));
expectedEntities.add(Arrays.asList("it"));
expectedEntities.add(Arrays.asList("the milk"));
expectedEntities.add(Arrays.asList("her bag"));
expectedEntities.add(Arrays.asList("Smith"));
List<List<String>> actualEntities = new ArrayList<List<String>>();
for (NamedEntity entity : JCasUtil.select(this.jCas, NamedEntity.class)) {
List<String> mentionTexts = new ArrayList<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,8 @@
*/
package org.cleartk.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import com.google.common.base.Charsets;
import com.google.common.io.Files;
import org.apache.uima.UIMAException;
import org.apache.uima.analysis_engine.AnalysisEngine;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
Expand All @@ -48,8 +41,11 @@
import org.cleartk.test.util.type.Token;
import org.junit.Test;

import com.google.common.base.Charsets;
import com.google.common.io.Files;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.*;

/**
* <br>
Expand All @@ -75,7 +71,6 @@ public static void getProcessedJCas(JCas jCas) throws Exception {
@Override
public void process(JCas jCas) throws AnalysisEngineProcessException {

try {
AnnotationFactory.createAnnotation(jCas, 0, 4, Token.class);
AnnotationFactory.createAnnotation(jCas, 0, 4, NamedEntityMention.class);
AnnotationFactory.createAnnotation(jCas, 0, 13, NamedEntityMention.class);
Expand Down Expand Up @@ -107,10 +102,6 @@ public void process(JCas jCas) throws AnalysisEngineProcessException {
AnnotationFactory.createAnnotation(jCas, 100, 109, Chunk.class);
AnnotationFactory.createAnnotation(jCas, 115, 124, Chunk.class);

} catch (UIMAException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

}
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-core</artifactId>
<version>2.5.0</version>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-document-annotation</artifactId>
<version>2.5.0</version>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimafit-core</artifactId>
<version>2.0.0</version>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down

0 comments on commit 6f84cf0

Please sign in to comment.