ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1891533 - /ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java
Date Wed, 14 Jul 2021 11:46:17 GMT
Author: seanfinan
Date: Wed Jul 14 11:46:17 2021
New Revision: 1891533

URL: http://svn.apache.org/viewvc?rev=1891533&view=rev
Log:
Set all DEPNode labels to "root" in case a (long) tree isn't parsed.

Modified:
    ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java

Modified: ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java?rev=1891533&r1=1891532&r2=1891533&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java
(original)
+++ ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java
Wed Jul 14 11:46:17 2021
@@ -193,9 +193,12 @@ public class ClearNLPDependencyParserAE
          // Convert CAS data into structures usable by ClearNLP
          for ( int i = 0; i < printableTokens.size(); i++ ) {
             BaseToken token = printableTokens.get( i );
-            String lemma = useLemmatizer ? lemmatizer.getLemma( token.getCoveredText(), token.getPartOfSpeech()
) : token.getNormalizedForm();
+            String lemma = useLemmatizer ? lemmatizer.getLemma( token.getCoveredText(), token.getPartOfSpeech()
)
+                                         : token.getNormalizedForm();
             DEPNode node = new DEPNode( i + 1, token.getCoveredText(), lemma, token.getPartOfSpeech(),
new DEPFeat() );
-            node.setHead(tree.get(0)); // in case we don't end up actually processing, point
everyone at the root.
+            // in case we don't end up actually processing, point everyone at the root -
created in DEPTree::new.
+            node.setHead( tree.get( 0 ) );
+            node.setLabel( "root" );
             tree.add( node );
          }
 



Mime
View raw message