...
  View open merge request
Commits (8)
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.schrieveslaach</groupId>
<artifactId>effective-nlp-application-development</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>converter</artifactId>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.8.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- Reader & Writer-->
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.io.penntree-asl</artifactId>
<version>1.9.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.io.xmi-asl</artifactId>
<version>1.9.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.schrieveslaach</groupId>
<artifactId>io.odt</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.io.text-asl</artifactId>
<version>1.9.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.io.conll-asl</artifactId>
<version>1.10.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
package de.schrieveslaach.effective.nlp.application.development.converter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application implements ApplicationRunner {
@Value("${filePattern}")
private String filePattern;
@Value("${replacePattern}")
private String replacePattern;
@Value("${targetLocation}")
private String targetLocation;
private final ConverterService converterService;
@Autowired
public Application(ConverterService converterService) {
this.converterService = converterService;
}
public static void main(String... args) {
SpringApplication.run(Application.class, args);
}
@Override
public void run(ApplicationArguments args) throws Exception {
converterService.setReplacePattern(replacePattern);
converterService.iterateOverFiles(filePattern, targetLocation);
}
}
\ No newline at end of file
package de.schrieveslaach.effective.nlp.application.development.converter.reader;
import de.tudarmstadt.ukp.dkpro.core.api.io.ResourceCollectionReaderBase;
import lombok.Getter;
import lombok.SneakyThrows;
import org.apache.uima.collection.CollectionReaderDescription;
import org.apache.uima.fit.pipeline.JCasIterable;
import org.apache.uima.resource.ResourceInitializationException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import static org.apache.uima.fit.factory.CollectionReaderFactory.createReaderDescription;
import static org.apache.uima.fit.pipeline.SimplePipeline.iteratePipeline;
@Component
public class SourceReader {
@Value("${sourceReaderClassName}")
private String sourceReaderClassName;
@Value("${sourceReaderLocation}")
private String sourceReaderLocation;
@Getter
private int size;
public JCasIterable createJCasForFile(String filePattern) {
if (sourceReaderClassName != null) {
Class<? extends ResourceCollectionReaderBase> sourceReaderClass = loadSourceReaderClass(sourceReaderClassName);
CollectionReaderDescription sourceReaderDescription = createSourceReaderDescription(sourceReaderClass,
loadSourceReaderConfiguration(filePattern).toArray());
return loadJCasIterable(sourceReaderDescription);
} else {
throw new IllegalArgumentException("SourceReaderClassName not provided.");
}
}
@SneakyThrows(ClassNotFoundException.class)
private Class loadSourceReaderClass(String sourceReaderClassName) {
return Class.forName(sourceReaderClassName);
}
private List<Object> loadSourceReaderConfiguration(String pattern) {
List<Object> keyValues = new ArrayList<>();
if (sourceReaderLocation != null) {
keyValues.add(ResourceCollectionReaderBase.PARAM_SOURCE_LOCATION);
keyValues.add(sourceReaderLocation);
}
if (pattern != null) {
keyValues.add(ResourceCollectionReaderBase.PARAM_PATTERNS);
keyValues.add(pattern);
} else {
keyValues.add(ResourceCollectionReaderBase.PARAM_PATTERNS);
keyValues.add("*");
}
return keyValues;
}
@SneakyThrows(ResourceInitializationException.class)
private CollectionReaderDescription createSourceReaderDescription(Class sourceReaderClass, Object... configurationData) {
return createReaderDescription(sourceReaderClass, configurationData);
}
private JCasIterable loadJCasIterable(CollectionReaderDescription sourceReaderDescription) {
return iteratePipeline(sourceReaderDescription);
}
}
package de.schrieveslaach.effective.nlp.application.development.converter.reader;
import de.tudarmstadt.ukp.dkpro.core.api.io.ResourceCollectionReaderBase;
import lombok.SneakyThrows;
import org.apache.uima.collection.CollectionReaderDescription;
import org.apache.uima.fit.pipeline.JCasIterable;
import org.apache.uima.resource.ResourceInitializationException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import static org.apache.uima.fit.factory.CollectionReaderFactory.createReaderDescription;
import static org.apache.uima.fit.pipeline.SimplePipeline.iteratePipeline;
@Component
public class TargetReader {
@Value("${targetReaderClassName}")
private String targetReaderClassName;
@Value("${targetReaderLocation}")
private String targetReaderLocation;
public JCasIterable createJCasForFiles(String filePattern) {
if (targetReaderClassName != null) {
Class<? extends ResourceCollectionReaderBase> targetReaderClass = loadTargetReaderClass(targetReaderClassName);
CollectionReaderDescription targetReaderDescription = createSourceReaderDescription(targetReaderClass,
loadSourceReaderConfiguration(filePattern).toArray());
return loadJCasIterable(targetReaderDescription);
} else {
throw new IllegalArgumentException("Class not provided.");
}
}
@SneakyThrows(ClassNotFoundException.class)
private Class loadTargetReaderClass(String targetReaderClassName) {
return Class.forName(targetReaderClassName);
}
private List<Object> loadSourceReaderConfiguration(String pattern) {
List<Object> keyValues = new ArrayList<>();
if (targetReaderLocation != null) {
keyValues.add(ResourceCollectionReaderBase.PARAM_SOURCE_LOCATION);
keyValues.add(targetReaderLocation);
}
if (pattern != null) {
keyValues.add(ResourceCollectionReaderBase.PARAM_PATTERNS);
keyValues.add(pattern);
}
return keyValues;
}
@SneakyThrows(ResourceInitializationException.class)
private CollectionReaderDescription createSourceReaderDescription(Class targetReaderClass, Object... configurationData) {
return createReaderDescription(targetReaderClass, configurationData);
}
private JCasIterable loadJCasIterable(CollectionReaderDescription targetReaderDescription) {
return iteratePipeline(targetReaderDescription);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmlns:pos="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/pos.ecore"
xmlns:tcas="http:///uima/tcas.ecore" xmlns:xmi="http://www.omg.org/XMI" xmlns:cas="http:///uima/cas.ecore"
xmlns:tweet="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/pos/tweet.ecore"
xmlns:morph="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/morph.ecore"
xmlns:dependency="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/dependency.ecore"
xmlns:type4="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type.ecore"
xmlns:type="http:///de/tudarmstadt/ukp/dkpro/core/api/metadata/type.ecore"
xmlns:type2="http:///de/tudarmstadt/ukp/dkpro/core/api/ner/type.ecore"
xmlns:type3="http:///de/tudarmstadt/ukp/dkpro/core/api/segmentation/type.ecore"
xmlns:constituent="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/constituent.ecore"
xmlns:chunk="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/chunk.ecore" xmi:version="2.0">
<cas:NULL xmi:id="0"/>
<type:DocumentMetaData xmi:id="1" sofa="12" begin="0" end="104" language="en"
documentTitle="1.xmi" documentId="1.xmi"
documentUri="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/1.xmi"
collectionId="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/"
documentBaseUri="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/"
isLastSegment="false"/>
<pos:POS xmi:id="487" sofa="12" begin="0" end="6" PosValue="JJ"/>
<pos:POS xmi:id="513" sofa="12" begin="7" end="9" PosValue="VBZ"/>
<pos:POS xmi:id="536" sofa="12" begin="10" end="15" PosValue="VBN"/>
<pos:POS xmi:id="559" sofa="12" begin="16" end="21" PosValue="IN"/>
<pos:POS xmi:id="590" sofa="12" begin="22" end="29" PosValue="JJ"/>
<pos:POS xmi:id="605" sofa="12" begin="30" end="37" PosValue="NNS"/>
<pos:POS xmi:id="632" sofa="12" begin="38" end="47" PosValue="VBG"/>
<pos:POS xmi:id="671" sofa="12" begin="48" end="59" PosValue="JJ"/>
<pos:POS xmi:id="686" sofa="12" begin="60" end="68" PosValue="NN"/>
<pos:POS xmi:id="713" sofa="12" begin="69" end="70" PosValue="-LRB-"/>
<pos:POS xmi:id="728" sofa="12" begin="71" end="74" PosValue="NN"/>
<pos:POS xmi:id="751" sofa="12" begin="75" end="76" PosValue="-RRB-"/>
<pos:POS xmi:id="774" sofa="12" begin="77" end="79" PosValue="IN"/>
<pos:POS xmi:id="805" sofa="12" begin="80" end="84" PosValue="NNS"/>
<pos:POS xmi:id="823" sofa="12" begin="85" end="88" PosValue="CC"/>
<pos:POS xmi:id="846" sofa="12" begin="89" end="94" PosValue="JJ"/>
<pos:POS xmi:id="861" sofa="12" begin="95" end="102" PosValue="NNS"/>
<pos:POS xmi:id="914" sofa="12" begin="103" end="104" PosValue="."/>
<type3:Token xmi:id="477" sofa="12" begin="0" end="6" parent="469" pos="487"/>
<type3:Token xmi:id="503" sofa="12" begin="7" end="9" parent="495" pos="513"/>
<type3:Token xmi:id="526" sofa="12" begin="10" end="15" parent="518" pos="536"/>
<type3:Token xmi:id="549" sofa="12" begin="16" end="21" parent="541" pos="559"/>
<type3:Token xmi:id="580" sofa="12" begin="22" end="29" parent="572" pos="590"/>
<type3:Token xmi:id="595" sofa="12" begin="30" end="37" parent="572" pos="605"/>
<type3:Token xmi:id="622" sofa="12" begin="38" end="47" parent="614" pos="632"/>
<type3:Token xmi:id="661" sofa="12" begin="48" end="59" parent="653" pos="671"/>
<type3:Token xmi:id="676" sofa="12" begin="60" end="68" parent="653" pos="686"/>
<type3:Token xmi:id="703" sofa="12" begin="69" end="70" parent="695" pos="713"/>
<type3:Token xmi:id="718" sofa="12" begin="71" end="74" parent="695" pos="728"/>
<type3:Token xmi:id="741" sofa="12" begin="75" end="76" parent="637" pos="751"/>
<type3:Token xmi:id="764" sofa="12" begin="77" end="79" parent="756" pos="774"/>
<type3:Token xmi:id="795" sofa="12" begin="80" end="84" parent="787" pos="805"/>
<type3:Token xmi:id="813" sofa="12" begin="85" end="88" parent="779" pos="823"/>
<type3:Token xmi:id="836" sofa="12" begin="89" end="94" parent="828" pos="846"/>
<type3:Token xmi:id="851" sofa="12" begin="95" end="102" parent="828" pos="861"/>
<type3:Token xmi:id="904" sofa="12" begin="103" end="104" parent="461" pos="914"/>
<constituent:Constituent xmi:id="461" sofa="12" begin="0" end="104" constituentType="S" parent="453"
children="469 495 904"/>
<constituent:Constituent xmi:id="469" sofa="12" begin="0" end="6" constituentType="NP" parent="461"
children="477" syntacticFunction="SBJ"/>
<constituent:Constituent xmi:id="495" sofa="12" begin="7" end="102" constituentType="VP" parent="461"
children="503 518"/>
<constituent:Constituent xmi:id="518" sofa="12" begin="10" end="102" constituentType="VP" parent="495"
children="526 541"/>
<constituent:Constituent xmi:id="541" sofa="12" begin="16" end="102" constituentType="PP" parent="518"
children="549 564"/>
<constituent:Constituent xmi:id="564" sofa="12" begin="22" end="102" constituentType="NP" parent="541"
children="572 614"/>
<constituent:Constituent xmi:id="572" sofa="12" begin="22" end="37" constituentType="NP" parent="564"
children="580 595"/>
<constituent:Constituent xmi:id="614" sofa="12" begin="38" end="102" constituentType="VP" parent="564"
children="622 637"/>
<constituent:Constituent xmi:id="637" sofa="12" begin="48" end="102" constituentType="NP" parent="614"
children="645 741 756"/>
<constituent:Constituent xmi:id="645" sofa="12" begin="48" end="74" constituentType="NP" parent="637"
children="653 695"/>
<constituent:Constituent xmi:id="653" sofa="12" begin="48" end="68" constituentType="NP" parent="645"
children="661 676"/>
<constituent:Constituent xmi:id="695" sofa="12" begin="69" end="74" constituentType="NP" parent="645"
children="703 718"/>
<constituent:Constituent xmi:id="756" sofa="12" begin="77" end="102" constituentType="PP" parent="637"
children="764 779" syntacticFunction="LOC"/>
<constituent:Constituent xmi:id="779" sofa="12" begin="80" end="102" constituentType="NP" parent="756"
children="787 813 828"/>
<constituent:Constituent xmi:id="787" sofa="12" begin="80" end="84" constituentType="NP" parent="779"
children="795"/>
<constituent:Constituent xmi:id="828" sofa="12" begin="89" end="102" constituentType="NP" parent="779"
children="836 851"/>
<constituent:ROOT xmi:id="453" sofa="12" begin="0" end="104" constituentType="ROOT" children="461"/>
<type3:Sentence xmi:id="927" sofa="12" begin="0" end="104"/>
<cas:Sofa xmi:id="12" sofaNum="1" sofaID="_InitialView" mimeType="text"
sofaString="Little is known about genetic factors affecting intraocular pressure ( IOP ) in mice and other mammals ."></cas:Sofa>
<cas:View sofa="12"
members="1 487 513 536 559 590 605 632 671 686 713 728 751 774 805 823 846 861 914 477 503 526 549 580 595 622 661 676 703 718 741 764 795 813 836 851 904 461 469 495 518 549 564 572 614 637 645 653 695 756 779 787 828 453 927"/>
</xmi:XMI>
\ No newline at end of file
This diff is collapsed.
package de.schrieveslaach.effective.nlp.application.development.converter;
import de.schrieveslaach.effective.nlp.application.development.converter.reader.SourceReader;
import de.schrieveslaach.effective.nlp.application.development.converter.reader.TargetReader;
import de.tudarmstadt.ukp.dkpro.core.api.io.ResourceCollectionReaderBase;
import de.tudarmstadt.ukp.dkpro.core.io.text.TextReader;
import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader;
import org.apache.uima.UIMAException;
import org.apache.uima.collection.CollectionReaderDescription;
import org.apache.uima.fit.pipeline.JCasIterable;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import static org.apache.commons.io.FileUtils.contentEquals;
import static org.apache.uima.fit.factory.CollectionReaderFactory.createReaderDescription;
import static org.apache.uima.fit.pipeline.SimplePipeline.iteratePipeline;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(SpringRunner.class)
@ActiveProfiles("test")
@SpringBootTest(classes = {
ApplicationTest.Config.class, ConverterService.class
})
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
public class ApplicationTest {
@Autowired
private ConverterService converterService;
@Autowired
private SourceReader sourceReader;
@Autowired
private TargetReader targetReader;
@Rule
public TemporaryFolder testFolder = new TemporaryFolder();
@Test
public void shouldConvertXMICorrect() throws Exception {
File sourceFile = new File(ClassLoader.getSystemResource("de.schrieveslaach.effective.nlp.application.development.converter/xmi/false.xmi").toURI());
File targetFile = new File(ClassLoader.getSystemResource("de.schrieveslaach.effective.nlp.application.development.converter/text/source.txt").toURI());
when(sourceReader.createJCasForFile("")).thenReturn(createJCasIterableFromFile(sourceFile, XmiReader.class));
when(targetReader.createJCasForFiles("")).thenReturn(createJCasIterableFromFile(targetFile, TextReader.class));
converterService.setReplacePattern("``/\"\\&''/\"");
converterService.iterateOverFiles("", testFolder.getRoot().getAbsolutePath());
File correct = new File(ClassLoader.getSystemResource("de.schrieveslaach.effective.nlp.application.development.converter/correct.xmi").toURI());
File converted = testFolder.getRoot().listFiles((file, s) -> s.matches(".\\.xmi|.\\.xmi\\.xmi"))[0];
assertTrue(contentEquals(correct, converted));
}
private JCasIterable createJCasIterableFromFile(File file, Class<? extends ResourceCollectionReaderBase> clazz) throws IOException, UIMAException {
CollectionReaderDescription readerDescription = createReaderDescription(
clazz,
ResourceCollectionReaderBase.PARAM_SOURCE_LOCATION, file);
return iteratePipeline(readerDescription);
}
public static class Config {
@Bean
SourceReader sourceReader() {
return mock(SourceReader.class);
}
@Bean
TargetReader targetReader() {
return mock(TargetReader.class);
}
}
}
package de.schrieveslaach.effective.nlp.application.development.converter.service;
public class ReaderServiceTest {
}
<?xml version="1.0" encoding="UTF-8"?><xmi:XMI xmlns:pos="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/pos.ecore" xmlns:tcas="http:///uima/tcas.ecore" xmlns:xmi="http://www.omg.org/XMI" xmlns:cas="http:///uima/cas.ecore" xmlns:tweet="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/pos/tweet.ecore" xmlns:morph="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/morph.ecore" xmlns:types="http:///de/schrieveslaach/effective/nlp/application/development/io/odt/types.ecore" xmlns:dependency="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/dependency.ecore" xmlns:type4="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type.ecore" xmlns:type="http:///de/tudarmstadt/ukp/dkpro/core/api/metadata/type.ecore" xmlns:type2="http:///de/tudarmstadt/ukp/dkpro/core/api/ner/type.ecore" xmlns:type3="http:///de/tudarmstadt/ukp/dkpro/core/api/segmentation/type.ecore" xmlns:constituent="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/constituent.ecore" xmlns:chunk="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/chunk.ecore" xmi:version="2.0">
<cas:NULL xmi:id="0"/>
<type:DocumentMetaData xmi:id="1" sofa="12" begin="0" end="101" language="en" documentTitle="1.xmi" documentId="1.xmi" documentUri="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/1.xmi" collectionId="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/" documentBaseUri="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/" isLastSegment="false"/>
<type3:Sentence xmi:id="19" sofa="12" begin="0" end="101"/>
<constituent:ROOT xmi:id="24" sofa="12" begin="0" end="101" constituentType="ROOT" children="35"/>
<constituent:Constituent xmi:id="35" sofa="12" begin="0" end="101" constituentType="S" parent="24" children="48 56 64"/>
<constituent:Constituent xmi:id="48" sofa="12" begin="0" end="6" constituentType="NP" parent="35" children="534" syntacticFunction="SBJ"/>
<constituent:Constituent xmi:id="56" sofa="12" begin="7" end="100" constituentType="VP" parent="35" children="86 98"/>
<constituent:Constituent xmi:id="98" sofa="12" begin="10" end="100" constituentType="VP" parent="56" children="110 122"/>
<constituent:Constituent xmi:id="146" sofa="12" begin="22" end="100" constituentType="NP" parent="122" children="158 166"/>
<constituent:Constituent xmi:id="158" sofa="12" begin="22" end="37" constituentType="NP" parent="146" children="477 489"/>
<constituent:Constituent xmi:id="166" sofa="12" begin="38" end="100" constituentType="VP" parent="146" children="178 190"/>
<constituent:Constituent xmi:id="190" sofa="12" begin="48" end="100" constituentType="NP" parent="166" children="203 211 223"/>
<constituent:Constituent xmi:id="203" sofa="12" begin="48" end="73" constituentType="NP" parent="190" children="371 379"/>
<constituent:Constituent xmi:id="371" sofa="12" begin="48" end="68" constituentType="NP" parent="203" children="431 443"/>
<constituent:Constituent xmi:id="379" sofa="12" begin="69" end="73" constituentType="NP" parent="203" children="391 403"/>
<constituent:Constituent xmi:id="223" sofa="12" begin="75" end="100" constituentType="PP" parent="190" children="235 247" syntacticFunction="LOC"/>
<constituent:Constituent xmi:id="247" sofa="12" begin="78" end="100" constituentType="NP" parent="223" children="260 268 280"/>
<constituent:Constituent xmi:id="260" sofa="12" begin="78" end="82" constituentType="NP" parent="247" children="337"/>
<constituent:Constituent xmi:id="280" sofa="12" begin="87" end="100" constituentType="NP" parent="247" children="292 304"/>
<type3:Token xmi:id="534" sofa="12" begin="0" end="6" parent="48" pos="546"/>
<type3:Token xmi:id="86" sofa="12" begin="7" end="9" parent="56" pos="525"/>
<type3:Token xmi:id="110" sofa="12" begin="10" end="15" parent="98" pos="519"/>
<type3:Token xmi:id="134" sofa="12" begin="16" end="21" parent="122" pos="513"/>
<type3:Token xmi:id="477" sofa="12" begin="22" end="29" parent="158" pos="507"/>
<type3:Token xmi:id="489" sofa="12" begin="30" end="37" parent="158" pos="501"/>
<type3:Token xmi:id="178" sofa="12" begin="38" end="47" parent="166" pos="467"/>
<type3:Token xmi:id="431" sofa="12" begin="48" end="59" parent="371" pos="461"/>
<type3:Token xmi:id="443" sofa="12" begin="60" end="68" parent="371" pos="455"/>
<type3:Token xmi:id="391" sofa="12" begin="69" end="70" parent="379" pos="421"/>
<type3:Token xmi:id="403" sofa="12" begin="70" end="73" parent="379" pos="415"/>
<type3:Token xmi:id="211" sofa="12" begin="73" end="74" parent="190" pos="361"/>
<type3:Token xmi:id="235" sofa="12" begin="75" end="77" parent="223" pos="355"/>
<type3:Token xmi:id="337" sofa="12" begin="78" end="82" parent="260" pos="349"/>
<type3:Token xmi:id="268" sofa="12" begin="83" end="86" parent="247" pos="328"/>
<type3:Token xmi:id="292" sofa="12" begin="87" end="92" parent="280" pos="322"/>
<type3:Token xmi:id="304" sofa="12" begin="93" end="100" parent="280" pos="316"/>
<type3:Token xmi:id="64" sofa="12" begin="100" end="101" parent="35" pos="76"/>
<pos:POS xmi:id="546" sofa="12" begin="0" end="6" PosValue="JJ"/>
<pos:POS xmi:id="525" sofa="12" begin="7" end="9" PosValue="VBZ"/>
<pos:POS xmi:id="519" sofa="12" begin="10" end="15" PosValue="VBN"/>
<pos:POS xmi:id="513" sofa="12" begin="16" end="21" PosValue="IN"/>
<pos:POS xmi:id="507" sofa="12" begin="22" end="29" PosValue="JJ"/>
<pos:POS xmi:id="501" sofa="12" begin="30" end="37" PosValue="NNS"/>
<pos:POS xmi:id="467" sofa="12" begin="38" end="47" PosValue="VBG"/>
<pos:POS xmi:id="461" sofa="12" begin="48" end="59" PosValue="JJ"/>
<pos:POS xmi:id="455" sofa="12" begin="60" end="68" PosValue="NN"/>
<pos:POS xmi:id="421" sofa="12" begin="69" end="70" PosValue="-LRB-"/>
<pos:POS xmi:id="415" sofa="12" begin="70" end="73" PosValue="NN"/>
<pos:POS xmi:id="361" sofa="12" begin="73" end="74" PosValue="-RRB-"/>
<pos:POS xmi:id="355" sofa="12" begin="75" end="77" PosValue="IN"/>
<pos:POS xmi:id="349" sofa="12" begin="78" end="82" PosValue="NNS"/>
<pos:POS xmi:id="328" sofa="12" begin="83" end="86" PosValue="CC"/>
<pos:POS xmi:id="322" sofa="12" begin="87" end="92" PosValue="JJ"/>
<pos:POS xmi:id="316" sofa="12" begin="93" end="100" PosValue="NNS"/>
<pos:POS xmi:id="76" sofa="12" begin="100" end="101" PosValue="."/>
<cas:Sofa xmi:id="12" sofaNum="1" sofaID="_InitialView" mimeType="text" sofaString="Little is known about genetic factors affecting intraocular pressure (IOP) in mice and other mammals."/>
<constituent:Constituent xmi:id="122" sofa="12" begin="16" end="102" constituentType="PP" parent="98" children="134 146"/>
<cas:View sofa="12" members="1 19 24 35 48 56 98 146 158 166 190 203 371 379 223 247 260 280 534 86 110 134 477 489 178 431 443 391 403 211 235 337 268 292 304 64 546 525 519 513 507 501 467 461 455 421 415 361 355 349 328 322 316 76"/>
</xmi:XMI>
Little is known about genetic factors affecting intraocular pressure (IOP) in mice and other mammals.
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmlns:pos="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/pos.ecore"
xmlns:tcas="http:///uima/tcas.ecore" xmlns:xmi="http://www.omg.org/XMI" xmlns:cas="http:///uima/cas.ecore"
xmlns:tweet="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/pos/tweet.ecore"
xmlns:morph="http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/morph.ecore"
xmlns:dependency="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/dependency.ecore"
xmlns:type4="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type.ecore"
xmlns:type="http:///de/tudarmstadt/ukp/dkpro/core/api/metadata/type.ecore"
xmlns:type2="http:///de/tudarmstadt/ukp/dkpro/core/api/ner/type.ecore"
xmlns:type3="http:///de/tudarmstadt/ukp/dkpro/core/api/segmentation/type.ecore"
xmlns:constituent="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/constituent.ecore"
xmlns:chunk="http:///de/tudarmstadt/ukp/dkpro/core/api/syntax/type/chunk.ecore" xmi:version="2.0">
<cas:NULL xmi:id="0"/>
<type:DocumentMetaData xmi:id="1" sofa="12" begin="0" end="104" language="en"
documentTitle="1.xmi" documentId="1.xmi"
documentUri="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/1.xmi"
collectionId="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/"
documentBaseUri="file:/home/henri/Projects/Towards-Effective-NLP-Application-Development/converter/src/main/resources/source/"
isLastSegment="false"/>
<pos:POS xmi:id="487" sofa="12" begin="0" end="6" PosValue="JJ"/>
<pos:POS xmi:id="513" sofa="12" begin="7" end="9" PosValue="VBZ"/>
<pos:POS xmi:id="536" sofa="12" begin="10" end="15" PosValue="VBN"/>
<pos:POS xmi:id="559" sofa="12" begin="16" end="21" PosValue="IN"/>
<pos:POS xmi:id="590" sofa="12" begin="22" end="29" PosValue="JJ"/>
<pos:POS xmi:id="605" sofa="12" begin="30" end="37" PosValue="NNS"/>
<pos:POS xmi:id="632" sofa="12" begin="38" end="47" PosValue="VBG"/>
<pos:POS xmi:id="671" sofa="12" begin="48" end="59" PosValue="JJ"/>
<pos:POS xmi:id="686" sofa="12" begin="60" end="68" PosValue="NN"/>
<pos:POS xmi:id="713" sofa="12" begin="69" end="70" PosValue="-LRB-"/>
<pos:POS xmi:id="728" sofa="12" begin="71" end="74" PosValue="NN"/>
<pos:POS xmi:id="751" sofa="12" begin="75" end="76" PosValue="-RRB-"/>
<pos:POS xmi:id="774" sofa="12" begin="77" end="79" PosValue="IN"/>
<pos:POS xmi:id="805" sofa="12" begin="80" end="84" PosValue="NNS"/>
<pos:POS xmi:id="823" sofa="12" begin="85" end="88" PosValue="CC"/>
<pos:POS xmi:id="846" sofa="12" begin="89" end="94" PosValue="JJ"/>
<pos:POS xmi:id="861" sofa="12" begin="95" end="102" PosValue="NNS"/>
<pos:POS xmi:id="914" sofa="12" begin="103" end="104" PosValue="."/>
<type3:Token xmi:id="477" sofa="12" begin="0" end="6" parent="469" pos="487"/>
<type3:Token xmi:id="503" sofa="12" begin="7" end="9" parent="495" pos="513"/>
<type3:Token xmi:id="526" sofa="12" begin="10" end="15" parent="518" pos="536"/>
<type3:Token xmi:id="549" sofa="12" begin="16" end="21" parent="541" pos="559"/>
<type3:Token xmi:id="580" sofa="12" begin="22" end="29" parent="572" pos="590"/>
<type3:Token xmi:id="595" sofa="12" begin="30" end="37" parent="572" pos="605"/>
<type3:Token xmi:id="622" sofa="12" begin="38" end="47" parent="614" pos="632"/>
<type3:Token xmi:id="661" sofa="12" begin="48" end="59" parent="653" pos="671"/>
<type3:Token xmi:id="676" sofa="12" begin="60" end="68" parent="653" pos="686"/>
<type3:Token xmi:id="703" sofa="12" begin="69" end="70" parent="695" pos="713"/>
<type3:Token xmi:id="718" sofa="12" begin="71" end="74" parent="695" pos="728"/>
<type3:Token xmi:id="741" sofa="12" begin="75" end="76" parent="637" pos="751"/>
<type3:Token xmi:id="764" sofa="12" begin="77" end="79" parent="756" pos="774"/>
<type3:Token xmi:id="795" sofa="12" begin="80" end="84" parent="787" pos="805"/>
<type3:Token xmi:id="813" sofa="12" begin="85" end="88" parent="779" pos="823"/>
<type3:Token xmi:id="836" sofa="12" begin="89" end="94" parent="828" pos="846"/>
<type3:Token xmi:id="851" sofa="12" begin="95" end="102" parent="828" pos="861"/>
<type3:Token xmi:id="904" sofa="12" begin="103" end="104" parent="461" pos="914"/>
<constituent:Constituent xmi:id="461" sofa="12" begin="0" end="104" constituentType="S" parent="453"
children="469 495 904"/>
<constituent:Constituent xmi:id="469" sofa="12" begin="0" end="6" constituentType="NP" parent="461"
children="477" syntacticFunction="SBJ"/>
<constituent:Constituent xmi:id="495" sofa="12" begin="7" end="102" constituentType="VP" parent="461"
children="503 518"/>
<constituent:Constituent xmi:id="518" sofa="12" begin="10" end="102" constituentType="VP" parent="495"
children="526 541"/>
<constituent:Constituent xmi:id="541" sofa="12" begin="16" end="102" constituentType="PP" parent="518"
children="549 564"/>
<constituent:Constituent xmi:id="564" sofa="12" begin="22" end="102" constituentType="NP" parent="541"
children="572 614"/>
<constituent:Constituent xmi:id="572" sofa="12" begin="22" end="37" constituentType="NP" parent="564"
children="580 595"/>
<constituent:Constituent xmi:id="614" sofa="12" begin="38" end="102" constituentType="VP" parent="564"
children="622 637"/>
<constituent:Constituent xmi:id="637" sofa="12" begin="48" end="102" constituentType="NP" parent="614"
children="645 741 756"/>
<constituent:Constituent xmi:id="645" sofa="12" begin="48" end="74" constituentType="NP" parent="637"
children="653 695"/>
<constituent:Constituent xmi:id="653" sofa="12" begin="48" end="68" constituentType="NP" parent="645"
children="661 676"/>
<constituent:Constituent xmi:id="695" sofa="12" begin="69" end="74" constituentType="NP" parent="645"
children="703 718"/>
<constituent:Constituent xmi:id="756" sofa="12" begin="77" end="102" constituentType="PP" parent="637"
children="764 779" syntacticFunction="LOC"/>
<constituent:Constituent xmi:id="779" sofa="12" begin="80" end="102" constituentType="NP" parent="756"
children="787 813 828"/>
<constituent:Constituent xmi:id="787" sofa="12" begin="80" end="84" constituentType="NP" parent="779"
children="795"/>
<constituent:Constituent xmi:id="828" sofa="12" begin="89" end="102" constituentType="NP" parent="779"
children="836 851"/>
<constituent:ROOT xmi:id="453" sofa="12" begin="0" end="104" constituentType="ROOT" children="461"/>
<type3:Sentence xmi:id="927" sofa="12" begin="0" end="104"/>
<cas:Sofa xmi:id="12" sofaNum="1" sofaID="_InitialView" mimeType="text"
sofaString="Little is known about genetic factors affecting intraocular pressure ( IOP ) in mice and other mammals ."></cas:Sofa>
<cas:View sofa="12"
members="1 487 513 536 559 590 605 632 671 686 713 728 751 774 805 823 846 861 914 477 503 526 549 580 595 622 661 676 703 718 741 764 795 813 836 851 904 461 469 495 518 549 564 572 614 637 645 653 695 756 779 787 828 453 927"/>
</xmi:XMI>
\ No newline at end of file
......@@ -35,8 +35,10 @@
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<license.licenseName>lgpl_v3</license.licenseName>
<license.processStartTag>========================LICENSE_START=================================</license.processStartTag>
<license.processEndTag>=========================LICENSE_END==================================</license.processEndTag>
<license.processStartTag>========================LICENSE_START=================================
</license.processStartTag>
<license.processEndTag>=========================LICENSE_END==================================
</license.processEndTag>
</properties>
<inceptionYear>2017</inceptionYear>
......@@ -77,6 +79,7 @@
<module>io-odt</module>
<module>effective-plumbing</module>
<module>nlp-maven-plugin</module>
<module>converter</module>
<module>quick-pad-tagger</module>
<module>acceptance-tests</module>
</modules>
......
......@@ -197,14 +197,14 @@ public class ProjectService {
// Set context class loader because umiaFIT relies on this one
Thread.currentThread().setContextClassLoader(classLoader);
updateMessage("Look up UIMA reader description for " + document.getName());
updateMessage("Look up UIMA de.schrieveslaach.effective.nlp.application.development.converter.reader description for " + document.getName());
List<CollectionReaderDescription> readerDescription = findReaderDescriptionByFileExtension(
classLoader,
document.getExtension(),
ComponentParameters.PARAM_SOURCE_LOCATION, document.getDoc());
if (readerDescription.isEmpty()) {
throw new ServiceException("Did not find any suitable reader description");
throw new ServiceException("Did not find any suitable de.schrieveslaach.effective.nlp.application.development.converter.reader description");
}
updateMessage("Load document");
......@@ -308,7 +308,7 @@ public class ProjectService {
Document document = currentDocument.get();
updateMessage("Look up UIMA writer description");
updateMessage("Look up UIMA de.schrieveslaach.effective.nlp.application.development.converter.writer description");
List<AnalysisEngineDescription> writerDescription = findWriterDescriptionByFileExtension(
classLoader,
document.getExtension(),
......@@ -317,7 +317,7 @@ public class ProjectService {
);
if (writerDescription.isEmpty()) {
throw new ServiceException("Did not find any suitable reader description");
throw new ServiceException("Did not find any suitable de.schrieveslaach.effective.nlp.application.development.converter.reader description");
}
// Set context class loader because umiaFIT relies on this one
......
......@@ -43,7 +43,7 @@
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
width="360"
height="360"
inkscape:export-filename="/home/marc/Projekte/Dissertation/Towards Effective NLP Application Development/quick-pad-tagger/src/main/resources/icon-32x32.png"
inkscape:export-filename="/home/marc/Projekte/Dissertation/Towards Effective NLP de.schrieveslaach.effective.nlp.application.development.converter.Application Development/quick-pad-tagger/src/main/resources/icon-32x32.png"
inkscape:export-xdpi="8.5299997"
inkscape:export-ydpi="8.5299997"><defs
id="defs19"><filter
......
......@@ -43,7 +43,7 @@
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
width="640"
height="360"
inkscape:export-filename="/home/marc/Projekte/Dissertation/Towards Effective NLP Application Development/quick-pad-tagger/src/main/resources/splash.png"
inkscape:export-filename="/home/marc/Projekte/Dissertation/Towards Effective NLP de.schrieveslaach.effective.nlp.application.development.converter.Application Development/quick-pad-tagger/src/main/resources/splash.png"
inkscape:export-xdpi="115.2"
inkscape:export-ydpi="115.2"><defs
id="defs19"><filter
......
......@@ -220,7 +220,7 @@ public class ProjectServiceTest extends GuiTest {
@Test
public void shouldNotLoadJCas_NoReaderDescription() throws Exception {
expectedException.expectMessage("Did not find any suitable reader description");
expectedException.expectMessage("Did not find any suitable de.schrieveslaach.effective.nlp.application.development.converter.reader description");
expectedException.expect(ServiceException.class);
File pom = createExampleCorpus();
......