Skip to content

Commit f7a029f

Browse files
authored
Merge pull request #98 from abrami/main
Update Mergins
2 parents 46fa9de + 211e623 commit f7a029f

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

src/main/java/org/texttechnologylab/DockerUnifiedUIMAInterface/DUUIFallbackCommunicationLayer.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ public void deserialize(JCas jc, ByteArrayInputStream input, String targetView)
4747
}
4848
}
4949

50+
@Override
51+
public void serialize(JCas jc, ByteArrayOutputStream out, Map<String, String> parameters) throws CompressorException, IOException, SAXException, CASException {
52+
serialize(jc, out, parameters, "_InitialView");
53+
}
54+
55+
@Override
56+
public void deserialize(JCas jc, ByteArrayInputStream input) throws IOException, SAXException, CASException {
57+
deserialize(jc, input, "_InitialView");
58+
}
59+
5060
public IDUUICommunicationLayer copy() {
5161
return new DUUIFallbackCommunicationLayer();
5262
}

src/main/java/org/texttechnologylab/DockerUnifiedUIMAInterface/IDUUICommunicationLayer.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import org.apache.uima.jcas.JCas;
66
import org.xml.sax.SAXException;
77

8-
import java.io.*;
8+
import java.io.ByteArrayInputStream;
9+
import java.io.ByteArrayOutputStream;
10+
import java.io.IOException;
911
import java.util.List;
1012
import java.util.Map;
1113

@@ -27,7 +29,7 @@ public interface IDUUICommunicationLayer {
2729
* @throws IOException
2830
* @throws SAXException
2931
*/
30-
public void serialize(JCas jc, ByteArrayOutputStream out, Map<String,String> parameters) throws CompressorException, IOException, SAXException;
32+
public void serialize(JCas jc, ByteArrayOutputStream out, Map<String, String> parameters) throws CompressorException, IOException, SAXException, CASException;
3133

3234
/**
3335
* Deserializes a byte array input stream to a JCas by using the LUA script provided by the component.
@@ -36,7 +38,7 @@ public interface IDUUICommunicationLayer {
3638
* @throws IOException
3739
* @throws SAXException
3840
*/
39-
public void deserialize(JCas jc, ByteArrayInputStream input) throws IOException, SAXException;
41+
public void deserialize(JCas jc, ByteArrayInputStream input) throws IOException, SAXException, CASException;
4042

4143
/**
4244
*

src/test/java/org/texttechnologylab/DockerUnifiedUIMAInterface/TestReadabilityReader.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.texttechnologylab.DockerUnifiedUIMAInterface;
22

3-
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph;
43
import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData;
4+
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph;
55
import org.apache.uima.UIMAException;
66
import org.apache.uima.cas.impl.XmiCasSerializer;
77
import org.apache.uima.collection.CollectionReaderDescription;
@@ -10,13 +10,14 @@
1010
import org.dkpro.core.io.xmi.XmiWriter;
1111
import org.junit.jupiter.api.Test;
1212
import org.texttechnologylab.DockerUnifiedUIMAInterface.driver.*;
13-
import org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.DUUIFileReader;
1413
import org.texttechnologylab.DockerUnifiedUIMAInterface.io.DUUIAsynchronousProcessor;
14+
import org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.DUUIFileReader;
1515
import org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.html.readability.DUUIHTMLReadabilityReader;
1616
import org.texttechnologylab.DockerUnifiedUIMAInterface.io.reader.html.readability.HTMLReadabilityLoader;
1717
import org.texttechnologylab.DockerUnifiedUIMAInterface.lua.DUUILuaContext;
1818
import org.texttechnologylab.DockerUnifiedUIMAInterface.segmentation.DUUISegmentationStrategyByAnnotation;
1919
import org.xml.sax.SAXException;
20+
2021
import javax.xml.parsers.ParserConfigurationException;
2122
import javax.xml.transform.OutputKeys;
2223
import java.io.BufferedReader;
@@ -26,9 +27,9 @@
2627
import java.nio.file.Path;
2728
import java.nio.file.Paths;
2829
import java.nio.file.StandardCopyOption;
29-
import java.util.zip.GZIPOutputStream;
30-
import java.util.List;
3130
import java.util.ArrayList;
31+
import java.util.List;
32+
import java.util.zip.GZIPOutputStream;
3233

3334
import static org.apache.uima.fit.factory.AnalysisEngineFactory.createEngineDescription;
3435
import static org.apache.uima.fit.factory.CollectionReaderFactory.createReaderDescription;
@@ -654,7 +655,7 @@ public void testGenreClassla() throws Exception {
654655
DUUIUIMADriver uimaDriver = new DUUIUIMADriver();
655656
DUUISwarmDriver swarmDriver = new DUUISwarmDriver();
656657
DUUIDockerDriver dockerDriver = new DUUIDockerDriver();
657-
DUUIKubernetesDriver kubernetesDriver = new DUUIDockerDriver();
658+
DUUIKubernetesDriver kubernetesDriver = new DUUIKubernetesDriver();
658659
composer.addDriver(uimaDriver, swarmDriver, dockerDriver, kubernetesDriver);
659660

660661

@@ -667,7 +668,6 @@ public void testGenreClassla() throws Exception {
667668
// .withParameter("selection", "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence")
668669
.withParameter("selection", "text")
669670
.withScale(scale)
670-
.withConstraintHost("isengart")
671671
.withLabels("hostname=isengart")
672672
.build()
673673
);

0 commit comments

Comments
 (0)