Skip to content

Commit

Permalink
Merge branch 'release/1.5.6'
Browse files Browse the repository at this point in the history
* release/1.5.6:
  Updated travis config for deployment
  Updated changelog
  1.5.6
  fix #150
  • Loading branch information
Nils Reiter committed Oct 20, 2018
2 parents 9d5cdca + 1277887 commit 7b62299
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 5 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
os: osx
osx_image: xcode9.3
language: java
jdk:
- oraclejdk8
script: mvn package -Pquadrama -Pcreta -Drelease=release
deploy:
skip_cleanup: true
provider: releases
api_key:
secure: iIB3NJmXlg0TIjqul5lpuRjF9YJf0syskDxgtdNrKTrFmRp/zXLvHBXzcYuHh+oS1DlueHChC+JRIIQx3NnP4LN9ErcgOAtQbpzl9EntCoGEtcMCd1bpwj1fLKirxxTBi9389g4dTutfIpK3nbhFU9vu6fOQVEKAle2x3g64zRIksUTWwCLTBn5UcctYEAgy+/Zi4uJwzzfEQUckDjCuaaFuIVuGfncK1n7hjtQA/omrgmHwGZ8910WHhgw4ErpKjyeooLvXcwzk/tbuvqFfbMhcqsscoaevkutfuygMCsVa4ux9y1F85QoE605zpSCYjwK4Pre/Y9rLPZ++SCuNS9gZ2wONqw69q5KJ8338hnNEGp+EXn1FwgbYvtYHxKVAFy7pF5MJaOCgWHEd8jC9miij0u21oRdcd1lc0eTATeNFXZ0BLWGmrm19Z0MrCu+7Pk1cku40tzA3cjRjLLMsZ3B8irNXIroj6AIVdkY8Md1OyDcAnxT3EGHawrPzl0+Q48FwPUCMptEBqMsgzjzN149ft3q/EAcfIO3ldFGz/4QXwfqodwHHvAWN1ctJFyH+kgrf3X5+DcH1Ce/9nZ635UYhyTrXem8c0v9yS0T5X5lsMy7As/I7r4Jr48C6278gcsmOh6ABFyaaK4fjOEXSkTpsGf+ITZPRU254/uV+/e4=
file_glob: true
file:
- target/CorefAnnotator-*-full.jar
- CorefAnnotator-*.dmg
on:
repo: nilsreiter/CorefAnnotator
tags: true
draft: true
name: $TRAVIS_TAG
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Issue numbers (e.g., #43) refer to GitHub issues:
https://github.com/nilsreiter/CorefAnnotator/issues

## 1.5.6

- Fixed an issue that prevented merging compressed files #150

## 1.5.5

- Fixed an issue that resulted in copied mentions #141
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.unistuttgart.ims</groupId>
<artifactId>coref.annotator</artifactId>
<version>1.5.5</version>
<version>1.5.6</version>
<packaging>jar</packaging>
<name>CorefAnnotator</name>
<url>https://github.com/nilsreiter/CorefAnnotator/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.fit.factory.AnnotationFactory;
import org.apache.uima.fit.factory.JCasFactory;
import org.apache.uima.fit.factory.TypeSystemDescriptionFactory;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.cas.FSArray;
import org.apache.uima.jcas.cas.StringArray;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.impl.factory.Maps;
import org.xml.sax.SAXException;

import de.unistuttgart.ims.coref.annotator.api.v1.DetachedMentionPart;
import de.unistuttgart.ims.coref.annotator.api.v1.Entity;
Expand All @@ -32,7 +31,9 @@ public class MergeAnnotations extends JCasAnnotator_ImplBase {
public void process(JCas jcas) throws AnalysisEngineProcessException {
getLogger().debug("Processing file " + fileName);
try {
JCas jcas2 = JCasFactory.createJCas(fileName, TypeSystemDescriptionFactory.createTypeSystemDescription());

JCas jcas2 = UimaUtil.readJCas(fileName);// JCasFactory.createJCas(fileName,
// TypeSystemDescriptionFactory.createTypeSystemDescription());

MutableMap<Entity, Entity> entityMap = Maps.mutable.empty();

Expand Down Expand Up @@ -90,7 +91,7 @@ public void process(JCas jcas) throws AnalysisEngineProcessException {
}
}

} catch (UIMAException | IOException e) {
} catch (UIMAException | IOException | SAXException e) {
throw new AnalysisEngineProcessException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package de.unistuttgart.ims.coref.annotator.uima;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;

import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.uima.UIMAException;
import org.apache.uima.cas.impl.XmiCasDeserializer;
import org.apache.uima.fit.factory.JCasFactory;
import org.apache.uima.jcas.JCas;
import org.xml.sax.SAXException;

public class UimaUtil {
public static JCas readJCas(String filename)
throws UIMAException, FileNotFoundException, SAXException, IOException {
if (filename.endsWith(".gz")) {
try (InputStream is = new GZIPInputStream(new FileInputStream(filename))) {
return readJCas(is);
}
} else if (filename.endsWith(".zip")) {
try (InputStream is = new ZipArchiveInputStream(new FileInputStream(filename))) {
return readJCas(is);
}
} else {
try (InputStream is = new FileInputStream(filename)) {
return readJCas(is);
}
}
}

public static JCas readJCas(InputStream is) throws UIMAException, SAXException, IOException {
JCas jcas = JCasFactory.createJCas();
XmiCasDeserializer.deserialize(is, jcas.getCas(), true);
return jcas;
}
}

0 comments on commit 7b62299

Please sign in to comment.