ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1693638 - /ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/nicu/PrintEntitiesAndEvents.java
Date Fri, 31 Jul 2015 18:33:55 GMT
Author: dligach
Date: Fri Jul 31 18:33:54 2015
New Revision: 1693638

URL: http://svn.apache.org/r1693638
Log:
now printing polarity value

Modified:
    ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/nicu/PrintEntitiesAndEvents.java

Modified: ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/nicu/PrintEntitiesAndEvents.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/nicu/PrintEntitiesAndEvents.java?rev=1693638&r1=1693637&r2=1693638&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/nicu/PrintEntitiesAndEvents.java
(original)
+++ ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/nicu/PrintEntitiesAndEvents.java
Fri Jul 31 18:33:54 2015
@@ -69,16 +69,18 @@ public class PrintEntitiesAndEvents {
     @Override
     public void process(JCas jCas) throws AnalysisEngineProcessException {
 
-      for (EventMention mention : Lists.newArrayList(JCasUtil.select(jCas, EventMention.class)))
{
-        String text = mention.getCoveredText().toLowerCase();
-        String semanticType = mention.getClass().getSimpleName();
-        System.out.format("%s|%s\n", text, semanticType);
+      for (EntityMention entityMention : Lists.newArrayList(JCasUtil.select(jCas, EntityMention.class)))
{
+        String text = entityMention.getCoveredText().toLowerCase();
+        String semanticType = entityMention.getClass().getSimpleName();
+        int polarity = entityMention.getPolarity();
+        System.out.format("%s|%s|%d\n", text, semanticType, polarity);
       }
 
-      for (EntityMention mention : Lists.newArrayList(JCasUtil.select(jCas, EntityMention.class)))
{
-        String text = mention.getCoveredText().toLowerCase();
-        String semanticType = mention.getClass().getSimpleName();
-        System.out.format("%s|%s\n", text, semanticType);
+      for (EventMention eventMention : Lists.newArrayList(JCasUtil.select(jCas, EventMention.class)))
{
+        String text = eventMention.getCoveredText().toLowerCase();
+        String semanticType = eventMention.getClass().getSimpleName();
+        int polarity = eventMention.getPolarity();
+        System.out.format("%s|%s|%d\n", text, semanticType, polarity);
       }
     }
   }



Mime
View raw message