incubator-ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1401070 - in /incubator/ctakes/trunk/ctakes-constituency-parser: desc/ src/main/java/org/apache/ctakes/constituency/parser/util/ src/main/resources/org/apache/ctakes/constituency/parser/models/
Date Mon, 22 Oct 2012 20:42:51 GMT
Author: tmill
Date: Mon Oct 22 20:42:50 2012
New Revision: 1401070

URL: http://svn.apache.org/viewvc?rev=1401070&view=rev
Log:
Check in new version of parser model, updated descriptor, and utility class for playing with
it.

Added:
    incubator/ctakes/trunk/ctakes-constituency-parser/desc/ConstituencyParserAnnotator.xml
    incubator/ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
  (with props)
    incubator/ctakes/trunk/ctakes-constituency-parser/src/main/resources/org/apache/ctakes/constituency/parser/models/sharpacq-1.5.bin
  (with props)

Added: incubator/ctakes/trunk/ctakes-constituency-parser/desc/ConstituencyParserAnnotator.xml
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-constituency-parser/desc/ConstituencyParserAnnotator.xml?rev=1401070&view=auto
==============================================================================
--- incubator/ctakes/trunk/ctakes-constituency-parser/desc/ConstituencyParserAnnotator.xml
(added)
+++ incubator/ctakes/trunk/ctakes-constituency-parser/desc/ConstituencyParserAnnotator.xml
Mon Oct 22 20:42:50 2012
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
+  <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+  <primitive>true</primitive>
+  <annotatorImplementationName>org.apache.ctakes.constituency.parser.ae.ConstituencyParser</annotatorImplementationName>
+  <analysisEngineMetaData>
+    <name>ConstituencyParserAnnotator</name>
+    <description/>
+    <version>1.0</version>
+    <vendor/>
+    <configurationParameters>
+      <configurationParameter>
+        <name>modelFilename</name>
+        <type>String</type>
+        <multiValued>false</multiValued>
+        <mandatory>true</mandatory>
+      </configurationParameter>
+    </configurationParameters>
+    <configurationParameterSettings>
+      <nameValuePair>
+        <name>modelFilename</name>
+        <value>
+          <string>org/apache/ctakes/constituency/parser/models/sharpacq-1.5.bin</string>
+        </value>
+      </nameValuePair>
+    </configurationParameterSettings>
+    <typeSystemDescription>
+      <imports>
+        <import name="org.apache.ctakes.typesystem.types.TypeSystem"/>
+      </imports>
+    </typeSystemDescription>
+    <typePriorities/>
+    <fsIndexCollection/>
+    <capabilities>
+      <capability>
+        <inputs/>
+        <outputs/>
+        <languagesSupported/>
+      </capability>
+    </capabilities>
+    <operationalProperties>
+      <modifiesCas>true</modifiesCas>
+      <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+      <outputsNewCASes>false</outputsNewCASes>
+    </operationalProperties>
+  </analysisEngineMetaData>
+  <resourceManagerConfiguration/>
+</analysisEngineDescription>

Added: incubator/ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java?rev=1401070&view=auto
==============================================================================
--- incubator/ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
(added)
+++ incubator/ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
Mon Oct 22 20:42:50 2012
@@ -0,0 +1,40 @@
+package org.apache.ctakes.constituency.parser.util;
+
+import java.io.IOException;
+import java.util.Scanner;
+
+import org.apache.ctakes.typesystem.type.syntax.TopTreebankNode;
+import org.apache.uima.UIMAException;
+import org.apache.uima.analysis_engine.AnalysisEngine;
+import org.apache.uima.cas.FSIterator;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.resource.metadata.TypeSystemDescription;
+import org.uimafit.factory.AnalysisEngineFactory;
+import org.uimafit.factory.JCasFactory;
+import org.uimafit.factory.TypeSystemDescriptionFactory;
+import org.uimafit.pipeline.SimplePipeline;
+
+public class CommandLineParserUtil {
+
+	/**
+	 * @param args
+	 * @throws IOException 
+	 * @throws UIMAException 
+	 */
+	public static void main(String[] args) throws UIMAException, IOException {
+		TypeSystemDescription types = TypeSystemDescriptionFactory.createTypeSystemDescription();
+		
+		AnalysisEngine ae = AnalysisEngineFactory.createAnalysisEngineFromPath("desc/analysis_engine/AggregateParsingProcessor.xml");
+		
+		Scanner scanner = new Scanner(System.in);
+		while(scanner.hasNextLine()){
+			JCas jcas = JCasFactory.createJCas(types);
+			jcas.setDocumentText(scanner.nextLine());
+			SimplePipeline.runPipeline(jcas, ae);
+			FSIterator iter = jcas.getAnnotationIndex(TopTreebankNode.type).iterator();
+			TopTreebankNode parse = (TopTreebankNode) iter.next();
+			System.out.println(parse.getTreebankParse());
+		}
+	}
+
+}

Propchange: incubator/ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ctakes/trunk/ctakes-constituency-parser/src/main/resources/org/apache/ctakes/constituency/parser/models/sharpacq-1.5.bin
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-constituency-parser/src/main/resources/org/apache/ctakes/constituency/parser/models/sharpacq-1.5.bin?rev=1401070&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ctakes/trunk/ctakes-constituency-parser/src/main/resources/org/apache/ctakes/constituency/parser/models/sharpacq-1.5.bin
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/ctakes/trunk/ctakes-constituency-parser/src/main/resources/org/apache/ctakes/constituency/parser/models/sharpacq-1.5.bin
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message