You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by dl...@apache.org on 2015/07/09 20:51:36 UTC
svn commit: r1690141 -
/ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/ClinicalConceptViewer.java
Author: dligach
Date: Thu Jul 9 18:51:36 2015
New Revision: 1690141
URL: http://svn.apache.org/r1690141
Log:
iterating over events and entities rather then identified annotations
Modified:
ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/ClinicalConceptViewer.java
Modified: ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/ClinicalConceptViewer.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/ClinicalConceptViewer.java?rev=1690141&r1=1690140&r2=1690141&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/ClinicalConceptViewer.java (original)
+++ ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/ClinicalConceptViewer.java Thu Jul 9 18:51:36 2015
@@ -20,6 +20,8 @@ package org.apache.ctakes.pipelines;
import java.io.File;
+import org.apache.ctakes.typesystem.type.textsem.EntityMention;
+import org.apache.ctakes.typesystem.type.textsem.EventMention;
import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
import org.apache.uima.analysis_engine.AnalysisEngine;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
@@ -78,8 +80,16 @@ public class ClinicalConceptViewer {
throw new AnalysisEngineProcessException(e);
}
- for(IdentifiedAnnotation idedAnnot : JCasUtil.select(systemView, IdentifiedAnnotation.class)) {
- System.out.println(idedAnnot.getCoveredText());
+ for(IdentifiedAnnotation mention : JCasUtil.select(systemView, EventMention.class)) {
+ String text = mention.getCoveredText().toLowerCase();
+ String semanticType = mention.getClass().getSimpleName();
+ System.out.format("%s|%s\n", text, semanticType);
+ }
+
+ for(IdentifiedAnnotation mention : JCasUtil.select(systemView, EntityMention.class)) {
+ String text = mention.getCoveredText().toLowerCase();
+ String semanticType = mention.getClass().getSimpleName();
+ System.out.format("%s|%s\n", text, semanticType);
}
}
}