ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1687482 - /ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/DeterministicMarkableAnnotator.java
Date Thu, 25 Jun 2015 11:36:17 GMT
Author: tmill
Date: Thu Jun 25 11:36:16 2015
New Revision: 1687482

URL: http://svn.apache.org/r1687482
Log:
Added condition to markable requiring parse tree to also call it a noun.

Modified:
    ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/DeterministicMarkableAnnotator.java

Modified: ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/DeterministicMarkableAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/DeterministicMarkableAnnotator.java?rev=1687482&r1=1687481&r2=1687482&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/DeterministicMarkableAnnotator.java
(original)
+++ ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/DeterministicMarkableAnnotator.java
Thu Jun 25 11:36:16 2015
@@ -60,6 +60,8 @@ public class DeterministicMarkableAnnota
     for(Segment seg : JCasUtil.select(jCas, Segment.class)){
       for(ConllDependencyNode node : JCasUtil.selectCovered(jCas, ConllDependencyNode.class,
seg)){
         String nodeText = node.getCoveredText().toLowerCase();
+        TerminalTreebankNode term = JCasUtil.selectCovered(TerminalTreebankNode.class, node).get(0);
+        
         if(node.getId() == 0){
           continue;
         }
@@ -69,7 +71,7 @@ public class DeterministicMarkableAnnota
         // 1) get nouns, and expand the markable to the phrase they cover
         // 2) get determiners like "this" and "these"
         // 3) non-passive "it"
-        if(node.getPostag().equals("NN") || node.getPostag().equals("NNS")){
+        if((node.getPostag().equals("NN") || node.getPostag().equals("NNS")) && term.getNodeType().startsWith("N")){
           if(node.getForm().matches("\\s+")) continue;
           // TODO fix this godawful hack:
           if(nodeText.equals("date") || nodeText.equals("tablet") || nodeText.equals("hg")
|| nodeText.equals("lb") || nodeText.equals("status")



Mime
View raw message