ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1728213 - /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/cr/MiPACQKnowtatorXMLReader.java
Date Tue, 02 Feb 2016 21:07:37 GMT
Author: tmill
Date: Tue Feb  2 21:07:37 2016
New Revision: 1728213

URL: http://svn.apache.org/viewvc?rev=1728213&view=rev
Log:
Removed warnings by updating generics.

Modified:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/cr/MiPACQKnowtatorXMLReader.java

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/cr/MiPACQKnowtatorXMLReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/cr/MiPACQKnowtatorXMLReader.java?rev=1728213&r1=1728212&r2=1728213&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/cr/MiPACQKnowtatorXMLReader.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/cr/MiPACQKnowtatorXMLReader.java
Tue Feb  2 21:07:37 2016
@@ -34,7 +34,6 @@ import org.apache.ctakes.assertion.util.
 import org.apache.ctakes.core.cc.XmiWriterCasConsumerCtakes;
 import org.apache.ctakes.core.knowtator.KnowtatorAnnotation;
 import org.apache.ctakes.core.knowtator.KnowtatorXMLParser;
-import org.apache.ctakes.core.util.CtakesFileNamer;
 import org.apache.ctakes.core.util.SHARPKnowtatorXMLDefaults;
 import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.refsem.BodyLaterality;
@@ -136,8 +135,9 @@ public class MiPACQKnowtatorXMLReader ex
   public static final String PARAM_SET_DEFAULTS = "SetDefaults";
   @ConfigurationParameter(
       name = PARAM_SET_DEFAULTS,
-      description = "whether or not to set default attribute values if no annotation is present")
-  private boolean setDefaults;
+      description = "whether or not to set default attribute values if no annotation is present",
+      mandatory=false)
+  private boolean setDefaults=true;
 
   private static final Map<String, String> SUBJECT_KNOWTATOR_TO_UIMA_MAP;
   static {
@@ -283,7 +283,7 @@ public class MiPACQKnowtatorXMLReader ex
     }
 
     // parse the Knowtator XML file into annotation objects
-    KnowtatorXMLParser parser = new KnowtatorXMLParser(this.getAnnotatorNames());
+    KnowtatorXMLParser parser = new KnowtatorXMLParser(getAnnotatorNames());
     Collection<KnowtatorAnnotation> annotations;
     try {
       annotations = parser.parse(knowtatorURI);
@@ -297,15 +297,15 @@ public class MiPACQKnowtatorXMLReader ex
     Set<String> nonAnnotationTypes = Sets.newHashSet(); // those expected not to have
spans
 
     // create a CAS object for each annotation
-    Map<String, TOP> idAnnotationMap = new HashMap<String, TOP>();
-    List<DelayedFeature> delayedFeatures = new ArrayList<DelayedFeature>();
+    Map<String, TOP> idAnnotationMap = new HashMap<>();
+    List<DelayedFeature> delayedFeatures = new ArrayList<>();
     LOGGER.info("Processing " + annotations.size() + " annotations for " + knowtatorURI);
     for (final KnowtatorAnnotation annotation : annotations) {
 
       // copy the slots so we can remove them as we use them
-      Map<String, String> stringSlots = new HashMap<String, String>(annotation.stringSlots);
-      Map<String, Boolean> booleanSlots = new HashMap<String, Boolean>(annotation.booleanSlots);
-      Map<String, KnowtatorAnnotation> annotationSlots = new HashMap<String, KnowtatorAnnotation>(
+      Map<String, String> stringSlots = new HashMap<>(annotation.stringSlots);
+      Map<String, Boolean> booleanSlots = new HashMap<>(annotation.booleanSlots);
+      Map<String, KnowtatorAnnotation> annotationSlots = new HashMap<>(
           annotation.annotationSlots);
       KnowtatorAnnotation.Span coveringSpan = annotation.getCoveringSpan();
       
@@ -1098,7 +1098,7 @@ public class MiPACQKnowtatorXMLReader ex
       }
 
       // make sure all slots have been consumed
-      Map<String, Set<String>> slotGroups = new HashMap<String, Set<String>>();
+      Map<String, Set<String>> slotGroups = new HashMap<>();
       slotGroups.put("stringSlots", stringSlots.keySet());
       slotGroups.put("booleanSlots", booleanSlots.keySet());
       slotGroups.put("annotationSlots", annotationSlots.keySet());



Mime
View raw message