ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1465739 - in /ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae: ClearNLPSemanticRoleLabelerAE.java util/WriteClearNLPDescriptors.java
Date Mon, 08 Apr 2013 19:40:50 GMT
Author: tmill
Date: Mon Apr  8 19:40:10 2013
New Revision: 1465739

URL: http://svn.apache.org/r1465739
Log:
ctakes-184: Quick fix to single-word sentence issue that checks the ConllDependencyNode id
before assigning.

Modified:
    ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java
    ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/util/WriteClearNLPDescriptors.java

Modified: ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java?rev=1465739&r1=1465738&r2=1465739&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java
(original)
+++ ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java
Mon Apr  8 19:40:10 2013
@@ -18,15 +18,9 @@
  */
 package org.apache.ctakes.dependency.parser.ae;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -59,7 +53,6 @@ import com.googlecode.clearnlp.dependenc
 import com.googlecode.clearnlp.dependency.DEPTree;
 import com.googlecode.clearnlp.engine.EngineGetter;
 import com.googlecode.clearnlp.nlp.NLPLib;
-
 import com.googlecode.clearnlp.reader.AbstractReader;
 
 /**
@@ -179,7 +172,11 @@ final String language = AbstractReader.L
         BaseToken token = tokens.get(i);
 
         // Determine HeadId
-        ConllDependencyNode casDepNode = JCasUtil.selectCovered(jCas, ConllDependencyNode.class,
token).get(0);
+        List<ConllDependencyNode> casDepNodes = JCasUtil.selectCovered(jCas, ConllDependencyNode.class,
token);
+        
+        ConllDependencyNode casDepNode = casDepNodes.get(0);
+        if(casDepNode.getId() == 0) casDepNode = casDepNodes.get(1);
+
         deprels[i] = casDepNode.getDeprel();
         ConllDependencyNode head = casDepNode.getHead();
 

Modified: ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/util/WriteClearNLPDescriptors.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/util/WriteClearNLPDescriptors.java?rev=1465739&r1=1465738&r2=1465739&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/util/WriteClearNLPDescriptors.java
(original)
+++ ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/util/WriteClearNLPDescriptors.java
Mon Apr  8 19:40:10 2013
@@ -80,7 +80,7 @@ public class WriteClearNLPDescriptors {
 		Options options = new Options();
 		options.parseOptions(args);
 
-		TypeSystemDescription typeSystem = TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath("../../../ctakes-type-system/desc/common_type_system.xml");
+		TypeSystemDescription typeSystem = TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath("../../../ctakes-type-system/src/main/resources/org/apache/ctakes/typesystem/types/TypeSystem.xml");
 
 		AnalysisEngineDescription ClearNLPSRLDesc = AnalysisEngineFactory.createPrimitiveDescription(
 				ClearNLPSemanticRoleLabelerAE.class,



Mime
View raw message