ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chen...@apache.org
Subject svn commit: r1724139 - in /ctakes/sandbox/ctakes-clinical-deid: ./ src/main/ src/main/resources/ src/main/resources/META-INF/ src/main/resources/META-INF/org.apache.uima.fit/ src/main/ruta/ src/main/ruta/org/ src/main/ruta/org/apache/ src/main/ruta/org...
Date Mon, 11 Jan 2016 22:44:43 GMT
Author: chenpei
Date: Mon Jan 11 22:44:42 2016
New Revision: 1724139

URL: http://svn.apache.org/viewvc?rev=1724139&view=rev
Log:
CTAKES-384 Applying patch.Thanks Peter Klugl.

Added:
    ctakes/sandbox/ctakes-clinical-deid/pom.xml   (with props)
    ctakes/sandbox/ctakes-clinical-deid/src/main/
    ctakes/sandbox/ctakes-clinical-deid/src/main/resources/
    ctakes/sandbox/ctakes-clinical-deid/src/main/resources/META-INF/
    ctakes/sandbox/ctakes-clinical-deid/src/main/resources/META-INF/org.apache.uima.fit/
    ctakes/sandbox/ctakes-clinical-deid/src/main/resources/META-INF/org.apache.uima.fit/types.txt
  (with props)
    ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/
    ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/
    ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/apache/
    ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/apache/ctakes/
    ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/apache/ctakes/deid/
    ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/apache/ctakes/deid/Deid.ruta
    ctakes/sandbox/ctakes-clinical-deid/src/test/
    ctakes/sandbox/ctakes-clinical-deid/src/test/java/
    ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/
    ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/
    ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/ctakes/
    ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/ctakes/deid/
    ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/ctakes/deid/DeidPipelineTest.java
  (with props)

Added: ctakes/sandbox/ctakes-clinical-deid/pom.xml
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-clinical-deid/pom.xml?rev=1724139&view=auto
==============================================================================
--- ctakes/sandbox/ctakes-clinical-deid/pom.xml (added)
+++ ctakes/sandbox/ctakes-clinical-deid/pom.xml Mon Jan 11 22:44:42 2016
@@ -0,0 +1,200 @@
+<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>
+
+  <artifactId>ctakes-clinical-deid</artifactId>
+
+  <parent>
+    <groupId>org.apache.ctakes</groupId>
+    <artifactId>ctakes</artifactId>
+    <version>3.2.3-SNAPSHOT</version>
+  </parent>
+
+  <properties>
+<!--     <ruta-version>2.4.0-SNAPSHOT</ruta-version> -->
+    <ruta-version>2.3.1</ruta-version>
+  </properties>
+
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.ctakes</groupId>
+      <artifactId>ctakes-clinical-pipeline</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.uima</groupId>
+      <artifactId>ruta-core</artifactId>
+      <version>${ruta-version}</version>
+    </dependency>
+  </dependencies>
+  
+  
+  
+  <build>
+    <resources>
+      <resource>
+        <directory>src/main/ruta</directory>
+      </resource>
+      <resource>
+        <directory>src/main/resources</directory>
+      </resource>
+      <resource>
+        <directory>target/generated-sources/ruta/descriptor</directory>
+      </resource>
+    </resources>
+  
+    <plugins>
+      <plugin>
+        <groupId>org.apache.uima</groupId>
+        <artifactId>ruta-maven-plugin</artifactId>
+        <version>${ruta-version}</version>
+        <executions>
+          <execution>
+            <id>descriptors</id>
+            <!-- use this phase so that the ruta script files are already 
+              copied to target/classes -->
+            <!-- no need to specify the included script directories with 
+              <scriptFiles> -->
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>generate</goal>
+            </goals>
+            <configuration>
+
+              <!-- This is a exemplary configuration, which explicitly specifies 
+                the default configuration values if not mentioned otherwise. -->
+               <scriptFiles>
+                <directory>${basedir}/src/main/ruta</directory>
+                <includes>
+                  <include>**/*.ruta</include>
+                </includes>
+               </scriptFiles>
+
+              <!-- The directory where the generated type system descriptors 
+                will be written stored. -->
+              <!-- default value: ${project.build.directory}/generated-sources/ruta/descriptor
-->
+              <typeSystemOutputDirectory>${project.build.directory}/generated-sources/ruta/descriptor</typeSystemOutputDirectory>
+
+              <!-- The directory where the generated analysis engine descriptors 
+                will be stored. -->
+              <!-- default value: ${project.build.directory}/generated-sources/ruta/descriptor
-->
+              <analysisEngineOutputDirectory>${project.build.directory}/generated-sources/ruta/descriptor</analysisEngineOutputDirectory>
+
+              <!-- The template descriptor for the generated type system. 
+                By default the descriptor of the maven dependency is loaded. -->
+              <!-- default value: none -->
+              <!-- not used in this example <typeSystemTemplate>...</typeSystemTemplate>
-->
+
+              <!-- The template descriptor for the generated analysis engine. 
+                By default the descriptor of the maven dependency is loaded. -->
+              <!-- default value: none -->
+              <!-- not used in this example <analysisEngineTemplate>...</analysisEngineTemplate>
-->
+
+              <!-- Script paths of the generated analysis engine descriptor. -->
+              <!-- default value: none -->
+              <scriptPaths>
+                <scriptPath>${basedir}/src/main/ruta/</scriptPath>
+              </scriptPaths>
+
+              <!-- Descriptor paths of the generated analysis engine descriptor. -->
+              <!-- default value: none -->
+              <descriptorPaths>
+                <descriptorPath>${project.build.directory}/generated-sources/ruta/descriptor</descriptorPath>
+              </descriptorPaths>
+
+              <!-- Resource paths of the generated analysis engine descriptor. -->
+              <!-- default value: none -->
+              <resourcePaths>
+                <resourcePath>${basedir}/src/main/resources/</resourcePath>
+                <resourcePath>${project.build.directory}/generated-sources/ruta/resources/</resourcePath>
+              </resourcePaths>
+
+              <!-- Suffix used for the generated type system descriptors. -->
+              <!-- default value: Engine -->
+              <analysisEngineSuffix>RutaAnnotator</analysisEngineSuffix>
+
+              <!-- Suffix used for the generated analysis engine descriptors. -->
+              <!-- default value: TypeSystem -->
+              <typeSystemSuffix>RutaTypeSystem</typeSystemSuffix>
+
+              <!-- Source file encoding. -->
+              <!-- default value: ${project.build.sourceEncoding} -->
+              <encoding>UTF-8</encoding>
+
+              <!-- Type of type system imports. false = import by location. -->
+              <!-- default value: false -->
+              <importByName>false</importByName>
+
+              <!-- Option to resolve imports while building. -->
+              <!-- default value: false -->
+              <resolveImports>false</resolveImports>
+
+              <!-- Amount of retries for building dependent descriptors. 
+                Default value -1 leads to three retires for each script. -->
+              <!-- default value: -1 -->
+              <maxBuildRetries>-1</maxBuildRetries>
+
+              <!-- List of packages with language extensions -->
+              <!-- default value: none -->
+              <extensionPackages>
+                <extensionPackage>org.apache.uima.ruta</extensionPackage>
+              </extensionPackages>
+
+              <!-- Add UIMA Ruta nature to .project -->
+              <!-- default value: false -->
+              <addRutaNature>true</addRutaNature>
+
+              <!-- Buildpath of the UIMA Ruta Workbench (IDE) for this project -->
+              <!-- default value: none -->
+              <buildPaths>
+                <buildPath>script:src/main/ruta/</buildPath>
+<!--                 <buildPath>descriptor:target/generated-sources/ruta/descriptor/</buildPath>
-->
+<!--                 <buildPath>resources:src/main/resources/wordlists</buildPath>
-->
+              </buildPaths>
+
+            </configuration>
+          </execution>
+<!--           <execution> -->
+<!--             <id>mtwl</id> -->
+<!--             <phase>generate-resources</phase> -->
+<!--             <goals> -->
+<!--               <goal>mtwl</goal> -->
+<!--             </goals> -->
+<!--             <configuration> -->
+<!--               Compress resulting tree word list. -->
+<!--               default value: true -->
+<!--               <compress>true</compress> -->
+<!--               The source files for the multi tree word list. -->
+<!--               default value: none -->
+<!--               <inputFiles> -->
+<!--                 <directory>${basedir}/src/main/resources/wordlists</directory>
-->
+<!--                 <includes> -->
+<!--                   <include>*.txt</include> -->
+<!--                 </includes> -->
+<!--               </inputFiles> -->
+<!--               default value: ${project.build.directory}/generated-sources/ruta/resources/generated.mtwl
-->
+<!--               <outputFile>${project.build.directory}/generated-sources/ruta/resources/generated.mtwl</outputFile>
-->
+<!--               Source file encoding. -->
+<!--               default value: ${project.build.sourceEncoding} -->
+<!--               <encoding>UTF-8</encoding> -->
+<!--             </configuration> -->
+<!--           </execution> -->
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.uima</groupId>
+        <artifactId>uimaj-core</artifactId>
+        <version>2.8.1</version>
+      </dependency>
+      <dependency>
+         <groupId>xml-apis</groupId>
+         <artifactId>xml-apis</artifactId>
+        <version>1.4.01</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+</project>
\ No newline at end of file

Propchange: ctakes/sandbox/ctakes-clinical-deid/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ctakes/sandbox/ctakes-clinical-deid/src/main/resources/META-INF/org.apache.uima.fit/types.txt
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-clinical-deid/src/main/resources/META-INF/org.apache.uima.fit/types.txt?rev=1724139&view=auto
==============================================================================
--- ctakes/sandbox/ctakes-clinical-deid/src/main/resources/META-INF/org.apache.uima.fit/types.txt
(added)
+++ ctakes/sandbox/ctakes-clinical-deid/src/main/resources/META-INF/org.apache.uima.fit/types.txt
Mon Jan 11 22:44:42 2016
@@ -0,0 +1,18 @@
+classpath*:org/apache/ctakes/typesystem/types/TypeSystem.xml
+classpath*:org/apache/ctakes/assertion/types/TypeSystem.xml
+classpath*:org/apache/ctakes/assertion/zoner/types/TypeSystem.xml
+classpath*:org/apache/ctakes/constituency/parser/types/LabeledTree.xml
+classpath*:org/apache/ctakes/coreference/types/TypeSystem.xml
+classpath*:org/apache/ctakes/drugner/types/TypeSystem.xml
+classpath*:org/apache/ctakes/padtermspotter/types/TypeSystem.xml
+classpath*:org/apache/ctakes/smokingstatus/types/TypeSystem.xml
+classpath*:org/apache/ctakes/sideeffect/types/TypeSystem.xml
+classpath*:org/apache/ctakes/typesystem/types/TypeSystem.xml
+classpath*:org/apache/ctakes/assertion/types/TypeSystem.xml
+classpath*:org/apache/ctakes/assertion/zoner/types/TypeSystem.xml
+classpath*:org/apache/ctakes/constituency/parser/types/LabeledTree.xml
+classpath*:org/apache/ctakes/coreference/types/TypeSystem.xml
+classpath*:org/apache/ctakes/drugner/types/TypeSystem.xml
+classpath*:org/apache/ctakes/padtermspotter/types/TypeSystem.xml
+classpath*:org/apache/ctakes/smokingstatus/types/TypeSystem.xml
+classpath*:org/apache/ctakes/sideeffect/types/TypeSystem.xml
\ No newline at end of file

Propchange: ctakes/sandbox/ctakes-clinical-deid/src/main/resources/META-INF/org.apache.uima.fit/types.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/apache/ctakes/deid/Deid.ruta
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/apache/ctakes/deid/Deid.ruta?rev=1724139&view=auto
==============================================================================
--- ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/apache/ctakes/deid/Deid.ruta (added)
+++ ctakes/sandbox/ctakes-clinical-deid/src/main/ruta/org/apache/ctakes/deid/Deid.ruta Mon
Jan 11 22:44:42 2016
@@ -0,0 +1,10 @@
+PACKAGE org.apache.ctakes.deid;
+
+TYPESYSTEM org.apache.ctakes.typesystem.types.TypeSystem;
+
+CW{-> IdentifiedAnnotation};
+PACKAGE org.apache.ctakes.deid;
+
+TYPESYSTEM org.apache.ctakes.typesystem.types.TypeSystem;
+
+CW{-> IdentifiedAnnotation};
\ No newline at end of file

Added: ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/ctakes/deid/DeidPipelineTest.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/ctakes/deid/DeidPipelineTest.java?rev=1724139&view=auto
==============================================================================
--- ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/ctakes/deid/DeidPipelineTest.java
(added)
+++ ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/ctakes/deid/DeidPipelineTest.java
Mon Jan 11 22:44:42 2016
@@ -0,0 +1,110 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ctakes.deid;
+
+import java.util.Collection;
+
+import junit.framework.Assert;
+
+import org.apache.ctakes.clinicalpipeline.ClinicalPipelineFactory;
+import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
+import org.apache.uima.fit.factory.AggregateBuilder;
+import org.apache.uima.fit.factory.AnalysisEngineFactory;
+import org.apache.uima.fit.factory.JCasFactory;
+import org.apache.uima.fit.pipeline.SimplePipeline;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+import org.junit.Test;
+
+public class DeidPipelineTest {
+
+  @Test
+  public void test() throws Exception {
+    String descriptorPath = "target/generated-sources/ruta/descriptor/org/apache/ctakes/deid/DeidRutaAnnotator.xml";
+
+    String document = "Hello World!";
+    JCas jcas = JCasFactory.createJCas();
+    jcas.setDocumentText(document);
+
+    AggregateBuilder builder = new AggregateBuilder();
+    builder.add(ClinicalPipelineFactory.getTokenProcessingPipeline());
+    builder.add(AnalysisEngineFactory.createEngineDescriptionFromPath(descriptorPath));
+
+    SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+
+    Collection<IdentifiedAnnotation> select = JCasUtil.select(jcas, IdentifiedAnnotation.class);
+    Assert.assertEquals(2, select.size());
+  }
+
+}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ctakes.deid;
+
+import java.util.Collection;
+
+import junit.framework.Assert;
+
+import org.apache.ctakes.clinicalpipeline.ClinicalPipelineFactory;
+import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
+import org.apache.uima.fit.factory.AggregateBuilder;
+import org.apache.uima.fit.factory.AnalysisEngineFactory;
+import org.apache.uima.fit.factory.JCasFactory;
+import org.apache.uima.fit.pipeline.SimplePipeline;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+import org.junit.Test;
+
+public class DeidPipelineTest {
+
+  @Test
+  public void test() throws Exception {
+    String descriptorPath = "target/generated-sources/ruta/descriptor/org/apache/ctakes/deid/DeidRutaAnnotator.xml";
+
+    String document = "Hello World!";
+    JCas jcas = JCasFactory.createJCas();
+    jcas.setDocumentText(document);
+
+    AggregateBuilder builder = new AggregateBuilder();
+    builder.add(ClinicalPipelineFactory.getTokenProcessingPipeline());
+    builder.add(AnalysisEngineFactory.createEngineDescriptionFromPath(descriptorPath));
+
+    SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+
+    Collection<IdentifiedAnnotation> select = JCasUtil.select(jcas, IdentifiedAnnotation.class);
+    Assert.assertEquals(2, select.size());
+  }
+
+}

Propchange: ctakes/sandbox/ctakes-clinical-deid/src/test/java/org/apache/ctakes/deid/DeidPipelineTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message