ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From james-mas...@apache.org
Subject svn commit: r1479635 - in /ctakes/trunk: ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/ ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/ ctakes-core/src/main/java/org/apache/ctakes/co...
Date Mon, 06 May 2013 16:40:37 GMT
Author: james-masanz
Date: Mon May  6 16:40:37 2013
New Revision: 1479635

URL: http://svn.apache.org/r1479635
Log:
CTAKES-190 dictionary lookup should create specific XxxxMention annotations instead of more
generic EntityMention. Some will now be instances of (subclasses of) EventMention instead
of EntityMention. This affected code that was looking at all EntityMentions.  (Still need
to update creation within drug-ner to be MedicationMention instead of MedicationEventMention
yet for this JIRA issue.)
 

Modified:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/ConditionalCleartkAnalysisEngine.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/GenericCleartkAnalysisEngine.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/HistoryCleartkAnalysisEngine.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/PolarityCleartkAnalysisEngine.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/UncertaintyCleartkAnalysisEngine.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/SurroundingExtractor.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/   (props changed)
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/FilterAnnotator.java
    ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/AnnotationSelector.java
    ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/PairAttributeCalculator.java
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/NamedEntityLookupConsumerImpl.java
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java
    ctakes/trunk/ctakes-drug-ner/src/main/java/org/apache/ctakes/drugner/ae/DrugMentionAnnotator.java
    ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/baselines/Utils.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/PrintRelations.java

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java
Mon May  6 16:40:37 2013
@@ -247,25 +247,26 @@ public abstract class AssertionCleartkAn
 //    Map<IdentifiedAnnotation, Collection<Sentence>> coveringSentenceMap = JCasUtil.indexCovering(identifiedAnnotationView,
IdentifiedAnnotation.class, Sentence.class);
 //    Map<Sentence, Collection<BaseToken>> tokensCoveredInSentenceMap = JCasUtil.indexCovered(identifiedAnnotationView,
Sentence.class, BaseToken.class);
 
-    Map<EntityMention, Collection<Zone>> coveringZoneMap =
-        JCasUtil.indexCovering(jCas, EntityMention.class, Zone.class);
+    Map<IdentifiedAnnotation, Collection<Zone>> coveringZoneMap =
+        JCasUtil.indexCovering(jCas, IdentifiedAnnotation.class, Zone.class);
     
     List<Instance<String>> instances = new ArrayList<Instance<String>>();
     // generate a list of training instances for each sentence in the document
     Collection<IdentifiedAnnotation> entities = JCasUtil.select(identifiedAnnotationView,
IdentifiedAnnotation.class);
-    for (IdentifiedAnnotation entityMention : entities)
+    for (IdentifiedAnnotation identifiedAnnotation : entities)
     {
-      if (!(entityMention instanceof EntityMention || entityMention instanceof EventMention))
+      if (!(identifiedAnnotation instanceof EntityMention || identifiedAnnotation instanceof
EventMention))
       {
         continue;
       }
-      if (entityMention.getPolarity() == -1)
+      IdentifiedAnnotation entityOrEventMention = identifiedAnnotation;
+      if (entityOrEventMention.getPolarity() == -1)
       {
         logger.debug(String.format(" - identified annotation: [%d-%d] polarity %d (%s)",
-            entityMention.getBegin(),
-            entityMention.getEnd(),
-            entityMention.getPolarity(),
-            entityMention.getClass().getName()));
+            entityOrEventMention.getBegin(),
+            entityOrEventMention.getEnd(),
+            entityOrEventMention.getPolarity(),
+            entityOrEventMention.getClass().getName()));
       }
       Instance<String> instance = new Instance<String>();
       
@@ -316,11 +317,11 @@ public abstract class AssertionCleartkAn
         */
       for (CleartkExtractor extractor : this.tokenCleartkExtractors) {
           //instance.addAll(extractor.extractWithin(identifiedAnnotationView, entityMention,
sentence));
-    	  instance.addAll(extractor.extract(identifiedAnnotationView, entityMention));
+    	  instance.addAll(extractor.extract(identifiedAnnotationView, entityOrEventMention));
         }
       
       List<Feature> cuePhraseFeatures =
-          cuePhraseInWindowExtractor.extract(jCas, entityMention);
+          cuePhraseInWindowExtractor.extract(jCas, entityOrEventMention);
           //cuePhraseInWindowExtractor.extractWithin(jCas, entityMention, firstCoveringSentence);
       
       if (cuePhraseFeatures != null && !cuePhraseFeatures.isEmpty())
@@ -332,26 +333,26 @@ public abstract class AssertionCleartkAn
         
       
       for (SimpleFeatureExtractor extractor : this.entityFeatureExtractors) {
-        instance.addAll(extractor.extract(jCas, entityMention));
+        instance.addAll(extractor.extract(jCas, entityOrEventMention));
       }
       
       
-      List<Feature> zoneFeatures = extractZoneFeatures(coveringZoneMap, entityMention);
+      List<Feature> zoneFeatures = extractZoneFeatures(coveringZoneMap, entityOrEventMention);
       if (zoneFeatures != null && !zoneFeatures.isEmpty())
       {
         instance.addAll(zoneFeatures);
       }
        
 
-      setClassLabel(entityMention, instance);
+      setClassLabel(entityOrEventMention, instance);
       
     }
     
   }
   
-  public List<Feature> extractZoneFeatures(Map<EntityMention, Collection<Zone>>
coveringZoneMap, IdentifiedAnnotation entityMention)
+  public List<Feature> extractZoneFeatures(Map<IdentifiedAnnotation, Collection<Zone>>
coveringZoneMap, IdentifiedAnnotation entityOrEventMention)
   {
-    final Collection<Zone> zoneList = coveringZoneMap.get(entityMention);
+    final Collection<Zone> zoneList = coveringZoneMap.get(entityOrEventMention);
     
     if (zoneList == null || zoneList.isEmpty())
     {

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/ConditionalCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/ConditionalCleartkAnalysisEngine.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/ConditionalCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/ConditionalCleartkAnalysisEngine.java
Mon May  6 16:40:37 2013
@@ -35,11 +35,11 @@ public class ConditionalCleartkAnalysisE
 	}
 	
 	@Override
-	public void setClassLabel(IdentifiedAnnotation entityMention,
+	public void setClassLabel(IdentifiedAnnotation entityOrEventMention,
 			Instance<String> instance) throws AnalysisEngineProcessException {
 		if (this.isTraining())
 	      {
-	        String conditional = (entityMention.getConditional()) ? "conditional" : "nonconditional";
+	        String conditional = (entityOrEventMention.getConditional()) ? "conditional" : "nonconditional";
 	        
 	        // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
 	        if ("nonconditional".equals(conditional) 
@@ -60,7 +60,7 @@ public class ConditionalCleartkAnalysisE
 	        {
 	          conditional = false;
 	        }
-	        entityMention.setConditional(conditional);
+	        entityOrEventMention.setConditional(conditional);
 	      }
 	}
 }

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/GenericCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/GenericCleartkAnalysisEngine.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/GenericCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/GenericCleartkAnalysisEngine.java
Mon May  6 16:40:37 2013
@@ -67,11 +67,11 @@ public class GenericCleartkAnalysisEngin
 	}
 	
 	@Override
-	public void setClassLabel(IdentifiedAnnotation entityMention,
+	public void setClassLabel(IdentifiedAnnotation entityOrEventMention,
 			Instance<String> instance) throws AnalysisEngineProcessException {
 		if (this.isTraining())
 	      {
-	        String generic = entityMention.getGeneric()? "1":"0";
+	        String generic = entityOrEventMention.getGeneric()? "1":"0";
 
 	        // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
 	        if ("0".equals(generic) 
@@ -83,7 +83,7 @@ public class GenericCleartkAnalysisEngin
 	      } else
 	      {
 	        String label = this.classifier.classify(instance.getFeatures());
-	        entityMention.setGeneric("1".equals(label));
+	        entityOrEventMention.setGeneric("1".equals(label));
 	      }
 	}
 

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/HistoryCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/HistoryCleartkAnalysisEngine.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/HistoryCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/HistoryCleartkAnalysisEngine.java
Mon May  6 16:40:37 2013
@@ -69,11 +69,11 @@ public class HistoryCleartkAnalysisEngin
 	}
 	
 	@Override
-	public void setClassLabel(IdentifiedAnnotation entityMention,
+	public void setClassLabel(IdentifiedAnnotation entityOrEventMention,
 			Instance<String> instance) throws AnalysisEngineProcessException {
 		if (this.isTraining())
 	      {
-			int history = entityMention.getHistoryOf(); 
+			int history = entityOrEventMention.getHistoryOf(); 
 
 	        // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
 	        if (history == CONST.NE_HISTORY_OF_ABSENT
@@ -86,7 +86,7 @@ public class HistoryCleartkAnalysisEngin
 	      } else
 	      {
 	        String label = this.classifier.classify(instance.getFeatures());
-	        entityMention.setHistoryOf(Integer.parseInt(label));
+	        entityOrEventMention.setHistoryOf(Integer.parseInt(label));
 	      }
 	}
 }

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/PolarityCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/PolarityCleartkAnalysisEngine.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/PolarityCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/PolarityCleartkAnalysisEngine.java
Mon May  6 16:40:37 2013
@@ -44,10 +44,10 @@ public class PolarityCleartkAnalysisEngi
 		this.entityFeatureExtractors.add(new ContextWordWindowExtractor("org/apache/ctakes/assertion/models/polarity.txt"));
 	}
 
-	public void setClassLabel(IdentifiedAnnotation entityMention, Instance<String> instance)
throws AnalysisEngineProcessException {
+	public void setClassLabel(IdentifiedAnnotation entityOrEventMention, Instance<String>
instance) throws AnalysisEngineProcessException {
 	      if (this.isTraining())
 	      {
-	        String polarity = (entityMention.getPolarity() == -1) ? "negated" : "present";
+	        String polarity = (entityOrEventMention.getPolarity() == -1) ? "negated" : "present";
 	        // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
 	        if ("negated".equals(polarity))
 	        {
@@ -70,10 +70,10 @@ public class PolarityCleartkAnalysisEngi
 	        {
 	          polarity = -1;
 	        }
-	        entityMention.setPolarity(polarity);
+	        entityOrEventMention.setPolarity(polarity);
 	        if ("negated".equals(label))
 	        {
-	          logger.debug(String.format("DECODING/EVAL: %s//%s [%d-%d] (%s)", label, polarity,
entityMention.getBegin(), entityMention.getEnd(), entityMention.getClass().getName()));
+	          logger.debug(String.format("DECODING/EVAL: %s//%s [%d-%d] (%s)", label, polarity,
entityOrEventMention.getBegin(), entityOrEventMention.getEnd(), entityOrEventMention.getClass().getName()));
 	        }
 	      }
 	}

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java
Mon May  6 16:40:37 2013
@@ -77,11 +77,11 @@ public class SubjectCleartkAnalysisEngin
 	}
 	
 	@Override
-	public void setClassLabel(IdentifiedAnnotation entityMention,
+	public void setClassLabel(IdentifiedAnnotation entityOrEventMention,
 			Instance<String> instance) throws AnalysisEngineProcessException {
 		if (this.isTraining())
 	      {
-	        String subj = entityMention.getSubject();
+	        String subj = entityOrEventMention.getSubject();
 	        
 	        // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
 	        if ("patient".equals(subj) 
@@ -98,8 +98,8 @@ public class SubjectCleartkAnalysisEngin
 	      } else
 	      {
 	        String label = this.classifier.classify(instance.getFeatures());
-	        entityMention.setSubject(label);
-	        logger.log(Level.DEBUG, "SUBJECT is being set on an IdentifiedAnnotation: "+label+"
"+entityMention.getSubject());
+	        entityOrEventMention.setSubject(label);
+	        logger.log(Level.DEBUG, "SUBJECT is being set on an IdentifiedAnnotation: "+label+"
"+entityOrEventMention.getSubject());
 	      }
 	}
 

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/UncertaintyCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/UncertaintyCleartkAnalysisEngine.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/UncertaintyCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/UncertaintyCleartkAnalysisEngine.java
Mon May  6 16:40:37 2013
@@ -34,10 +34,10 @@ public class UncertaintyCleartkAnalysisE
 	}
 	
 	@Override
-	public void setClassLabel(IdentifiedAnnotation entityMention, Instance<String> instance)
throws AnalysisEngineProcessException {
+	public void setClassLabel(IdentifiedAnnotation entityOrEventMention, Instance<String>
instance) throws AnalysisEngineProcessException {
 		if (this.isTraining())
 	      {
-	        String uncertainty = (entityMention.getUncertainty() == 1) ? "uncertain" : "certain";
+	        String uncertainty = (entityOrEventMention.getUncertainty() == 1) ? "uncertain"
: "certain";
 
 	        // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
 	        if ("certain".equals(uncertainty) 
@@ -57,7 +57,7 @@ public class UncertaintyCleartkAnalysisE
 	        {
 	          uncertainty = 0;
 	        }
-	        entityMention.setUncertainty(uncertainty);
+	        entityOrEventMention.setUncertainty(uncertainty);
 	      }
 	}
 

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/SurroundingExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/SurroundingExtractor.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/SurroundingExtractor.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/SurroundingExtractor.java
Mon May  6 16:40:37 2013
@@ -34,8 +34,8 @@ public class SurroundingExtractor implem
 		logger.info("SurroundingExtractor.extract() BEGIN");
 		//JCasUtil.indexCovering(jcas, IdentifiedAnnotation.class, this.ancestorAnnotationClass)
 		
-		Map<EntityMention, Collection<Zone>> coveringMap =
-			JCasUtil.indexCovering(jcas, EntityMention.class, Zone.class);
+		Map<IdentifiedAnnotation, Collection<Zone>> coveringMap =
+			JCasUtil.indexCovering(jcas, IdentifiedAnnotation.class, Zone.class);
 		
 		IdentifiedAnnotation targetEntityAnnotation = (IdentifiedAnnotation)targetAnnotation;
 		

Propchange: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon May  6 16:40:37 2013
@@ -0,0 +1 @@
+SHARPKnowtatorXMLReader.java.TEXT

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/FilterAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/FilterAnnotator.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/FilterAnnotator.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/FilterAnnotator.java
Mon May  6 16:40:37 2013
@@ -34,6 +34,7 @@ import org.apache.uima.jcas.tcas.Annotat
 import org.apache.uima.resource.ResourceInitializationException;
 
 import org.apache.ctakes.typesystem.type.textsem.EntityMention;
+import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
 
 public class FilterAnnotator extends JCasAnnotator_ImplBase {
 	// TODO parameterize retainAttrTypeId = DISORDER_ANNOTATIONS = 2
@@ -77,7 +78,7 @@ public class FilterAnnotator extends JCa
 	}
 
 	private boolean isValid(Annotation ann) {
-		if (((EntityMention) ann).getTypeID() != retainAttrTypeId)
+		if (((IdentifiedAnnotation) ann).getTypeID() != retainAttrTypeId)
 			return false;
 
 		return true;

Modified: ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/AnnotationSelector.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/AnnotationSelector.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/AnnotationSelector.java
(original)
+++ ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/AnnotationSelector.java
Mon May  6 16:40:37 2013
@@ -35,6 +35,7 @@ import org.apache.ctakes.typesystem.type
 import org.apache.ctakes.typesystem.type.syntax.TreebankNode;
 import org.apache.ctakes.typesystem.type.syntax.WordToken;
 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.ctakes.typesystem.type.textspan.Sentence;
 
@@ -45,16 +46,19 @@ public class AnnotationSelector {
 
 	public static ArrayList<Annotation> selectNE (JCas jcas) {
 		ArrayList<Annotation> ret = new ArrayList<Annotation>();
-		FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(EntityMention.type).iterator();
+		FSIterator<Annotation> iter = jcas.getJFSIndexRepository().getAnnotationIndex(IdentifiedAnnotation.type).iterator();
 		while (iter.hasNext()) {
-			EntityMention a = (EntityMention) iter.next();
-			if(a.getOntologyConceptArr() != null)
+		  IdentifiedAnnotation a = (IdentifiedAnnotation) iter.next();
+		  if (a instanceof EntityMention || a instanceof EventMention) {
+			if(a.getOntologyConceptArr() != null) {
 //			int tid = a.getTypeID();
 //			if (tid == TypeSystemConst.NE_TYPE_ID_ANATOMICAL_SITE ||
 //				tid == TypeSystemConst.NE_TYPE_ID_DISORDER ||
 //				tid == TypeSystemConst.NE_TYPE_ID_PROCEDURE ||
 //				tid == TypeSystemConst.NE_TYPE_ID_FINDING)
 				ret.add(a);
+			}
+		  }
 		}
 		java.util.Collections.sort(ret, new AnnotOffsetComparator());
 		return ret;
@@ -62,7 +66,7 @@ public class AnnotationSelector {
 
 	public static ArrayList<BaseToken> selectBaseToken (JCas jcas) {
 		ArrayList<BaseToken> ret = new ArrayList<BaseToken>();
-		FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(BaseToken.type).iterator();
+		FSIterator<?> iter = jcas.getJFSIndexRepository().getAnnotationIndex(BaseToken.type).iterator();
 		while (iter.hasNext())
 			ret.add((BaseToken)iter.next());
 		java.util.Collections.sort(ret, new AnnotOffsetComparator());
@@ -71,7 +75,7 @@ public class AnnotationSelector {
 
 	public static ArrayList<Sentence> selectSentence (JCas jcas) {
 		ArrayList<Sentence> ret = new ArrayList<Sentence>();
-		FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(Sentence.type).iterator();
+		FSIterator<Annotation> iter = jcas.getJFSIndexRepository().getAnnotationIndex(Sentence.type).iterator();
 		while (iter.hasNext())
 			ret.add((Sentence)iter.next());
 		java.util.Collections.sort(ret, new AnnotOffsetComparator());
@@ -83,7 +87,7 @@ public class AnnotationSelector {
 			Logger logger) {
 		Hashtable<String, WordToken> offset2token = new Hashtable<String, WordToken>();
 		ArrayList<WordToken> ret = new ArrayList<WordToken>();
-		FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(WordToken.type).iterator();
+		FSIterator<Annotation> iter = jcas.getJFSIndexRepository().getAnnotationIndex(WordToken.type).iterator();
 		while (iter.hasNext()) {
 			WordToken t = (WordToken)iter.next();
 			String s = t.getCoveredText();
@@ -138,8 +142,8 @@ public class AnnotationSelector {
 							findP(adjP, "SBAR", 1)!=null ||
 							findP(adjP, "S", 1)!=null))
 						return true;
-				} else if (isBe((TreebankNode) par.getChildren(0))) {
-					firstChild = (TreebankNode) vp.getChildren(0);
+				} else if (isBe(par.getChildren(0))) {
+					firstChild = vp.getChildren(0);
 					if (firstChild!=null && cogved.contains(firstChild.getCoveredText()) &&
 							(findP(vp, "SBAR", 1)!=null ||
 							findP(vp, "S", 1)!=null))
@@ -182,12 +186,13 @@ public class AnnotationSelector {
 						txt.equalsIgnoreCase("been") ||
 						txt.equalsIgnoreCase("be")))
 			return true;
-		else return false;
+		
+		return false;
 	}
 
 	public static ArrayList<Chunk> selectDemonAndRelative (JCas jcas) {
 		ArrayList<Chunk> ret = new ArrayList<Chunk>();
-		FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(Chunk.type).iterator();
+		FSIterator<Annotation> iter = jcas.getJFSIndexRepository().getAnnotationIndex(Chunk.type).iterator();
 		while (iter.hasNext()) {
 			Chunk c = (Chunk)iter.next();
 			if (c.getChunkType().equals("NP")) {

Modified: ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/PairAttributeCalculator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/PairAttributeCalculator.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/PairAttributeCalculator.java
(original)
+++ ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/util/PairAttributeCalculator.java
Mon May  6 16:40:37 2013
@@ -18,37 +18,19 @@
  */
 package org.apache.ctakes.coreference.util;
 
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.PrintWriter;
-import java.rmi.UnexpectedException;
 import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Scanner;
 
-import org.apache.uima.cas.FSIterator;
-import org.apache.uima.cas.Type;
-import org.apache.uima.cas.text.AnnotationIndex;
-import org.apache.uima.jcas.JCas;
-import org.apache.uima.jcas.cas.FSArray;
-import org.apache.uima.jcas.cas.StringArray;
-import org.apache.uima.jcas.tcas.Annotation;
-
-import org.apache.ctakes.core.resource.FileLocator;
-import org.apache.ctakes.coreference.util.AnnotationSelector;
+import org.apache.ctakes.coreference.type.Markable;
 import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.refsem.UmlsConcept;
-import org.apache.ctakes.typesystem.type.syntax.BaseToken;
 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.ctakes.typesystem.type.textspan.LookupWindowAnnotation;
-import org.apache.ctakes.typesystem.type.textspan.Segment;
-import org.apache.ctakes.coreference.type.DemMarkable;
-import org.apache.ctakes.coreference.type.Markable;
-import org.apache.ctakes.coreference.type.NEMarkable;
-import org.apache.ctakes.coreference.type.PronounMarkable;
+import org.apache.uima.cas.FSIterator;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.cas.FSArray;
+import org.apache.uima.jcas.tcas.Annotation;
 
 public class PairAttributeCalculator extends AttributeCalculator {
 
@@ -551,9 +533,9 @@ public class PairAttributeCalculator ext
 	}
 
 	public boolean calcNegatedBoth(){
-		if(a1 instanceof EntityMention && a2 instanceof EntityMention){
-			if(((EntityMention)a1).getPolarity() == -1 &&
-			   ((EntityMention)a2).getPolarity() == -1){
+		if((a1 instanceof EntityMention && a2 instanceof EntityMention) || (a1 instanceof
EventMention && a2 instanceof EventMention)){
+			if(((IdentifiedAnnotation)a1).getPolarity() == -1 &&
+			   ((IdentifiedAnnotation)a2).getPolarity() == -1){
 				return true;
 			}
 		}
@@ -561,9 +543,9 @@ public class PairAttributeCalculator ext
 	}
 	
 	public boolean calcNonNegatedBoth(){
-		if(a1 instanceof EntityMention && a2 instanceof EntityMention){
-			if(((EntityMention)a1).getPolarity() == 1.0 &&
-			   ((EntityMention)a2).getPolarity() == 1.0){
+		if(a1 instanceof EntityMention && a2 instanceof EntityMention || (a1 instanceof
EventMention && a2 instanceof EventMention)){
+			if(((IdentifiedAnnotation)a1).getPolarity() == 1.0 &&
+			   ((IdentifiedAnnotation)a2).getPolarity() == 1.0){
 				return true;
 			}
 		}

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/NamedEntityLookupConsumerImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/NamedEntityLookupConsumerImpl.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/NamedEntityLookupConsumerImpl.java
(original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/NamedEntityLookupConsumerImpl.java
Mon May  6 16:40:37 2013
@@ -22,9 +22,14 @@ import org.apache.ctakes.dictionary.look
 import org.apache.ctakes.dictionary.lookup.vo.LookupHit;
 import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.refsem.OntologyConcept;
+import org.apache.ctakes.typesystem.type.textsem.AnatomicalSiteMention;
+import org.apache.ctakes.typesystem.type.textsem.DiseaseDisorderMention;
 import org.apache.ctakes.typesystem.type.textsem.EntityMention;
 import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
-import org.apache.ctakes.typesystem.type.textsem.MedicationEventMention;
+import org.apache.ctakes.typesystem.type.textsem.LabMention;
+import org.apache.ctakes.typesystem.type.textsem.MedicationMention;
+import org.apache.ctakes.typesystem.type.textsem.ProcedureMention;
+import org.apache.ctakes.typesystem.type.textsem.SignSymptomMention;
 import org.apache.uima.UimaContext;
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
@@ -107,11 +112,22 @@ public class NamedEntityLookupConsumerIm
                codes.add( code );
             }
          }
-         IdentifiedAnnotation neAnnot;
-         if ( typeId == CONST.NE_TYPE_ID_DRUG || typeId == CONST.NE_TYPE_ID_UNKNOWN ) {
-            neAnnot = new MedicationEventMention( jcas );
+         
+         IdentifiedAnnotation neAnnot = new IdentifiedAnnotation(jcas);
+         if ( typeId == CONST.NE_TYPE_ID_DRUG ) {
+            neAnnot = new MedicationMention( jcas );
+         } else if ( typeId == CONST.NE_TYPE_ID_ANATOMICAL_SITE ) {
+             neAnnot = new AnatomicalSiteMention( jcas );
+         } else if ( typeId == CONST.NE_TYPE_ID_DISORDER ) {
+             neAnnot = new DiseaseDisorderMention( jcas );
+         } else if ( typeId == CONST.NE_TYPE_ID_FINDING ) {
+             neAnnot = new SignSymptomMention( jcas );
+         } else if ( typeId == CONST.NE_TYPE_ID_LAB ) {
+             neAnnot = new LabMention( jcas );
+         } else if ( typeId == CONST.NE_TYPE_ID_PROCEDURE ) {
+             neAnnot = new ProcedureMention( jcas );
          } else {
-            neAnnot = new EntityMention( jcas );
+             neAnnot = new EntityMention( jcas );
          }
          final int neBegin = entry.getKey().__start;
          final int neEnd = entry.getKey().__end;

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java
(original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java
Mon May  6 16:40:37 2013
@@ -23,9 +23,14 @@ import org.apache.ctakes.dictionary.look
 import org.apache.ctakes.dictionary.lookup.vo.LookupHit;
 import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.refsem.UmlsConcept;
+import org.apache.ctakes.typesystem.type.textsem.AnatomicalSiteMention;
+import org.apache.ctakes.typesystem.type.textsem.DiseaseDisorderMention;
 import org.apache.ctakes.typesystem.type.textsem.EntityMention;
 import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
-import org.apache.ctakes.typesystem.type.textsem.MedicationEventMention;
+import org.apache.ctakes.typesystem.type.textsem.LabMention;
+import org.apache.ctakes.typesystem.type.textsem.MedicationMention;
+import org.apache.ctakes.typesystem.type.textsem.ProcedureMention;
+import org.apache.ctakes.typesystem.type.textsem.SignSymptomMention;
 import org.apache.uima.UimaContext;
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
@@ -250,9 +255,19 @@ public abstract class UmlsToSnomedConsum
                   IdentifiedAnnotation neAnnot;
                   final int conceptKey = conceptEntry.getKey();
                   if ( conceptKey == CONST.NE_TYPE_ID_DRUG ) {
-                     neAnnot = new MedicationEventMention( jcas );
+                     neAnnot = new MedicationMention( jcas );
+                  } else if ( conceptKey == CONST.NE_TYPE_ID_ANATOMICAL_SITE ) {
+                      neAnnot = new AnatomicalSiteMention( jcas );
+                  } else if ( conceptKey == CONST.NE_TYPE_ID_DISORDER ) {
+                      neAnnot = new DiseaseDisorderMention( jcas );
+                  } else if ( conceptKey == CONST.NE_TYPE_ID_FINDING ) {
+                      neAnnot = new SignSymptomMention( jcas );
+                  } else if ( conceptKey == CONST.NE_TYPE_ID_LAB ) {
+                      neAnnot = new LabMention( jcas );
+                  } else if ( conceptKey == CONST.NE_TYPE_ID_PROCEDURE ) {
+                      neAnnot = new ProcedureMention( jcas );
                   } else {
-                     neAnnot = new EntityMention( jcas );
+                      neAnnot = new EntityMention( jcas );
                   }
                   neAnnot.setTypeID( conceptKey );
                   neAnnot.setBegin( neBegin );

Modified: ctakes/trunk/ctakes-drug-ner/src/main/java/org/apache/ctakes/drugner/ae/DrugMentionAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-drug-ner/src/main/java/org/apache/ctakes/drugner/ae/DrugMentionAnnotator.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-drug-ner/src/main/java/org/apache/ctakes/drugner/ae/DrugMentionAnnotator.java
(original)
+++ ctakes/trunk/ctakes-drug-ner/src/main/java/org/apache/ctakes/drugner/ae/DrugMentionAnnotator.java
Mon May  6 16:40:37 2013
@@ -106,7 +106,7 @@ import org.apache.ctakes.typesystem.type
 import org.apache.ctakes.typesystem.type.syntax.SymbolToken;
 import org.apache.ctakes.typesystem.type.syntax.WordToken;
 import org.apache.ctakes.typesystem.type.textsem.DateAnnotation;
-import org.apache.ctakes.typesystem.type.textsem.EntityMention;
+import org.apache.ctakes.typesystem.type.textsem.EventMention;
 import org.apache.ctakes.typesystem.type.textsem.MedicationEventMention;
 import org.apache.ctakes.typesystem.type.textspan.Segment;
 import org.apache.ctakes.typesystem.type.textspan.Sentence;
@@ -989,7 +989,7 @@ public class DrugMentionAnnotator extend
 			}
 		} catch (ArrayIndexOutOfBoundsException aioobe) { 
 			allNEs = 
-				FSUtil.getAnnotationsInSpan(jcas, EntityMention.type, begin, end, validNeTypes);
+				FSUtil.getAnnotationsInSpan(jcas, EventMention.type, begin, end, validNeTypes);
 
 			uniqueNEs = findUniqueMentions(allNEs.toArray());
 

Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/baselines/Utils.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/baselines/Utils.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/baselines/Utils.java
(original)
+++ ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/baselines/Utils.java
Mon May  6 16:40:37 2013
@@ -6,6 +6,7 @@ import java.util.HashSet;
 import java.util.List;
 
 import org.apache.ctakes.relationextractor.ae.RelationExtractorAnnotator.IdentifiedAnnotationPair;
+import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.syntax.BaseToken;
 import org.apache.ctakes.typesystem.type.syntax.TreebankNode;
 import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
@@ -28,14 +29,16 @@ public class Utils {
   public static boolean validateLocationOfArgumentTypes(IdentifiedAnnotationPair pair) {
     
     // allowable arg2 types for location_of
-    HashSet<Integer> okArg2Types = new HashSet<Integer>(Arrays.asList(2, 3, 5));
+	// Per CTAKES-190, only link anatomical sites in LocationOf to EventMentions, but these
three are EventMentions now, 
+	// so this check of type ID now already handles if it is an EventMention. 
+    HashSet<Integer> okArg2Types = new HashSet<Integer>(Arrays.asList(CONST.NE_TYPE_ID_DISORDER,
CONST.NE_TYPE_ID_FINDING, CONST.NE_TYPE_ID_PROCEDURE));
     
     IdentifiedAnnotation arg1 = pair.getArg1(); // Argument (should be anatomical site)
     IdentifiedAnnotation arg2 = pair.getArg2(); // Related_to (should be either disorder,
sign/symptom, or procedure)
     int type1 = arg1.getTypeID();
     int type2 = arg2.getTypeID();
     
-    if(type1 == 6 && okArg2Types.contains(type2)) {
+    if(type1 == CONST.NE_TYPE_ID_ANATOMICAL_SITE && okArg2Types.contains(type2))
{
       return true;
     }
     
@@ -52,7 +55,9 @@ public class Utils {
   public static boolean validateDegreeOfArgumentTypes(IdentifiedAnnotationPair pair) {
 
     // allowable arg1 types
-    HashSet<Integer> okArg1Types = new HashSet<Integer>(Arrays.asList(2, 3));
+	// Per CTAKES-190, only link SeverityModifiers to EventMention, but the 2 type IDs below
are EventMentions now, 
+    // so this check of type ID now already handles if it is an EventMention. 
+    HashSet<Integer> okArg1Types = new HashSet<Integer>(Arrays.asList(CONST.NE_TYPE_ID_DISORDER,
CONST.NE_TYPE_ID_FINDING));
 
     IdentifiedAnnotation arg1 = pair.getArg1(); // Argument (should be either disease/disorder
or sign/symptom
     int type1 = arg1.getTypeID();

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Mon May  6 16:40:37 2013
@@ -54,6 +54,7 @@ import org.apache.ctakes.typesystem.type
 import org.apache.ctakes.typesystem.type.syntax.Chunk;
 import org.apache.ctakes.typesystem.type.syntax.TreebankNode;
 import org.apache.ctakes.typesystem.type.textsem.EntityMention;
+import org.apache.ctakes.typesystem.type.textsem.EventMention;
 import org.apache.ctakes.typesystem.type.textsem.TimeMention;
 import org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation;
 import org.apache.ctakes.typesystem.type.textspan.Segment;
@@ -454,6 +455,16 @@ public abstract class Evaluation_ImplBas
     }
   }
 
+  public static class EventMentionRemover extends JCasAnnotator_ImplBase {
+
+    @Override
+    public void process(JCas jCas) throws AnalysisEngineProcessException {
+      for (EventMention mention : Lists.newArrayList(JCasUtil.select(jCas, EventMention.class)))
{
+        mention.removeFromIndexes();
+      }
+    }
+  }
+  
   // replace this with SimpleSegmentWithTagsAnnotator if that code ever gets fixed
   public static class SegmentsFromBracketedSectionTagsAnnotator extends JCasAnnotator_ImplBase
{
     private static Pattern SECTION_PATTERN = Pattern.compile(

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/PrintRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/PrintRelations.java?rev=1479635&r1=1479634&r2=1479635&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/PrintRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/PrintRelations.java
Mon May  6 16:40:37 2013
@@ -30,6 +30,8 @@ import java.util.TreeSet;
 import org.apache.ctakes.temporal.ae.THYMEKnowtatorXMLReader;
 import org.apache.ctakes.typesystem.type.relation.BinaryTextRelation;
 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.collection.CollectionReader;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.tcas.Annotation;
@@ -89,8 +91,10 @@ public class PrintRelations {
       List<BinaryTextRelation> relationList = new ArrayList<BinaryTextRelation>(relations);
       Collections.sort(relationList, BY_RELATION_OFFSETS);
 
-      for (EntityMention entityMention : JCasUtil.select(jCas, EntityMention.class)) {
-        System.err.printf("%s (%s)\n", entityMention.getCoveredText(), entityMention.getTypeID());
+      for (IdentifiedAnnotation identifiedAnnotation : JCasUtil.select(jCas, IdentifiedAnnotation.class))
{
+    	if (identifiedAnnotation instanceof EventMention || identifiedAnnotation instanceof
EntityMention) {
+    		System.err.printf("%s (%s)\n", identifiedAnnotation.getCoveredText(), identifiedAnnotation.getTypeID());
+    	}
       }
 
       // print out the relations for visual inspection



Mime
View raw message