incubator-ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevenbeth...@apache.org
Subject svn commit: r1401767 - in /incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal: ae/ ae/feature/ eval/
Date Wed, 24 Oct 2012 16:37:45 GMT
Author: stevenbethard
Date: Wed Oct 24 16:37:44 2012
New Revision: 1401767

URL: http://svn.apache.org/viewvc?rev=1401767&view=rev
Log:
Fixes new warnings in ctakes-temporal revealed by new warnings settings

Modified:
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/TimeAnnotator.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/CoveredTextToValuesExtractor.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/AnnotationCopier.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java?rev=1401767&r1=1401766&r2=1401767&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
Wed Oct 24 16:37:44 2012
@@ -40,7 +40,8 @@ import org.cleartk.classifier.feature.ex
 import org.cleartk.classifier.feature.extractor.simple.CoveredTextExtractor;
 import org.cleartk.classifier.feature.extractor.simple.TypePathExtractor;
 import org.cleartk.classifier.jar.DefaultDataWriterFactory;
-import org.cleartk.classifier.jar.JarClassifierFactory;
+import org.cleartk.classifier.jar.DirectoryDataWriterFactory;
+import org.cleartk.classifier.jar.GenericJarClassifierFactory;
 import org.uimafit.factory.AnalysisEngineFactory;
 import org.uimafit.util.JCasUtil;
 
@@ -55,7 +56,7 @@ public class DocTimeRelAnnotator extends
         true,
         DefaultDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME,
         dataWriterClass,
-        DefaultDataWriterFactory.PARAM_OUTPUT_DIRECTORY,
+        DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY,
         outputDirectory);
   }
 
@@ -65,7 +66,7 @@ public class DocTimeRelAnnotator extends
         DocTimeRelAnnotator.class,
         CleartkAnnotator.PARAM_IS_TRAINING,
         false,
-        JarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
+        GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
         new File(modelDirectory, "model.jar"));
   }
 

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java?rev=1401767&r1=1401766&r2=1401767&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
Wed Oct 24 16:37:44 2012
@@ -53,7 +53,8 @@ import org.cleartk.classifier.feature.ex
 import org.cleartk.classifier.feature.extractor.simple.SimpleFeatureExtractor;
 import org.cleartk.classifier.feature.extractor.simple.TypePathExtractor;
 import org.cleartk.classifier.jar.DefaultDataWriterFactory;
-import org.cleartk.classifier.jar.JarClassifierFactory;
+import org.cleartk.classifier.jar.DirectoryDataWriterFactory;
+import org.cleartk.classifier.jar.GenericJarClassifierFactory;
 import org.uimafit.factory.AnalysisEngineFactory;
 import org.uimafit.util.JCasUtil;
 
@@ -75,7 +76,7 @@ public class EventAnnotator extends Clea
         true,
         DefaultDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME,
         dataWriterClass,
-        DefaultDataWriterFactory.PARAM_OUTPUT_DIRECTORY,
+        DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY,
         outputDirectory);
   }
 
@@ -85,7 +86,7 @@ public class EventAnnotator extends Clea
         EventAnnotator.class,
         CleartkAnnotator.PARAM_IS_TRAINING,
         false,
-        JarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
+        GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
         new File(modelDirectory, "model.jar"));
   }
 

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/TimeAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/TimeAnnotator.java?rev=1401767&r1=1401766&r2=1401767&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/TimeAnnotator.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/TimeAnnotator.java
Wed Oct 24 16:37:44 2012
@@ -45,7 +45,8 @@ import org.cleartk.classifier.feature.ex
 import org.cleartk.classifier.feature.extractor.simple.SimpleFeatureExtractor;
 import org.cleartk.classifier.feature.extractor.simple.TypePathExtractor;
 import org.cleartk.classifier.jar.DefaultDataWriterFactory;
-import org.cleartk.classifier.jar.JarClassifierFactory;
+import org.cleartk.classifier.jar.DirectoryDataWriterFactory;
+import org.cleartk.classifier.jar.GenericJarClassifierFactory;
 import org.uimafit.factory.AnalysisEngineFactory;
 import org.uimafit.util.JCasUtil;
 
@@ -60,7 +61,7 @@ public class TimeAnnotator extends Clear
         true,
         DefaultDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME,
         dataWriterClass,
-        DefaultDataWriterFactory.PARAM_OUTPUT_DIRECTORY,
+        DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY,
         outputDirectory);
   }
 
@@ -70,7 +71,7 @@ public class TimeAnnotator extends Clear
         TimeAnnotator.class,
         CleartkAnnotator.PARAM_IS_TRAINING,
         false,
-        JarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
+        GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
         new File(modelDirectory, "model.jar"));
   }
 

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/CoveredTextToValuesExtractor.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/CoveredTextToValuesExtractor.java?rev=1401767&r1=1401766&r2=1401767&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/CoveredTextToValuesExtractor.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/CoveredTextToValuesExtractor.java
Wed Oct 24 16:37:44 2012
@@ -64,8 +64,8 @@ public class CoveredTextToValuesExtracto
     }
     ArrayList<Feature> features = new ArrayList<Feature>();
     for (int i = 0; i < values.length; ++i) {
-      String name = Feature.createName(this.name, String.valueOf(i));
-      features.add(new Feature(name, values[i]));
+      String featureName = Feature.createName(this.name, String.valueOf(i));
+      features.add(new Feature(featureName, values[i]));
     }
     return features;
   }

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/AnnotationCopier.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/AnnotationCopier.java?rev=1401767&r1=1401766&r2=1401767&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/AnnotationCopier.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/AnnotationCopier.java
Wed Oct 24 16:37:44 2012
@@ -65,22 +65,22 @@ public class AnnotationCopier extends JC
 
   @Override
   public void process(JCas jCas) throws AnalysisEngineProcessException {
-    JCas sourceView, targetView;
+    JCas sourceJCas, targetJCas;
     try {
-      sourceView = jCas.getView(this.sourceView);
-      targetView = jCas.getView(this.targetView);
+      sourceJCas = jCas.getView(this.sourceView);
+      targetJCas = jCas.getView(this.targetView);
     } catch (CASException e) {
       throw new AnalysisEngineProcessException(e);
     }
-    CasCopier copier = new CasCopier(sourceView.getCas(), targetView.getCas());
-    for (TOP annotation : JCasUtil.select(sourceView, this.annotationClass)) {
+    CasCopier copier = new CasCopier(sourceJCas.getCas(), targetJCas.getCas());
+    for (TOP annotation : JCasUtil.select(sourceJCas, this.annotationClass)) {
       TOP copy = (TOP) copier.copyFs(annotation);
       // CasCopier does not change sofa of annotation; without the code below, you get the
error:
       // the Annotation "..." is over view "GoldView" and cannot be added to indexes associated
       // with the different view "_InitialView".
       Feature sofaFeature = copy.getType().getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFA);
       if (sofaFeature != null) {
-        copy.setFeatureValue(sofaFeature, targetView.getSofa());
+        copy.setFeatureValue(sofaFeature, targetJCas.getSofa());
       }
       copy.addToIndexes();
     }

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java?rev=1401767&r1=1401766&r2=1401767&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Wed Oct 24 16:37:44 2012
@@ -70,7 +70,7 @@ public abstract class Evaluation_ImplBas
 
   public enum AnnotatorType {
     PART_OF_SPEECH_TAGS, UMLS_NAMED_ENTITIES, LEXICAL_VARIANTS, DEPENDENCIES, SEMANTIC_ROLES
-  };
+  }
 
   protected final String GOLD_VIEW_NAME = "GoldView";
 
@@ -112,9 +112,9 @@ public abstract class Evaluation_ImplBas
   }
 
   @Override
-  protected CollectionReader getCollectionReader(List<Integer> patientSets) throws
Exception {
+  protected CollectionReader getCollectionReader(List<Integer> selectedPatientSets)
throws Exception {
     List<File> files = new ArrayList<File>();
-    for (Integer set : patientSets) {
+    for (Integer set : selectedPatientSets) {
       File setTextDirectory = new File(this.rawTextDirectory, "doc" + set);
       for (File file : setTextDirectory.listFiles()) {
         files.add(file);
@@ -137,7 +137,7 @@ public abstract class Evaluation_ImplBas
 
   private static enum PipelineType {
     TRAIN, TEST
-  };
+  }
 
   private AnalysisEngineDescription getPreprocessorDescription(PipelineType pipelineType)
       throws Exception {



Mime
View raw message