ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1465100 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Date Fri, 05 Apr 2013 19:28:46 GMT
Author: clin
Date: Fri Apr  5 19:28:45 2013
New Revision: 1465100

URL: http://svn.apache.org/r1465100
Log:
check if rawTextDirectory exists for evaluation script.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java

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=1465100&r1=1465099&r2=1465100&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
Fri Apr  5 19:28:45 2013
@@ -24,6 +24,7 @@ import java.io.FileOutputStream;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -150,21 +151,24 @@ public abstract class Evaluation_ImplBas
   }
   
   private List<File> getFilesFor(List<Integer> patientSets) {
-    List<File> files = new ArrayList<File>();
-    for (Integer set : patientSets) {
-      final int setNum = set;
-      for (File file : rawTextDirectory.listFiles(new FilenameFilter(){
-        @Override
-        public boolean accept(File dir, String name) {
-          return name.contains(String.format("ID%03d", setNum));
-        }})) {
-        // skip hidden files like .svn
-        if (!file.isHidden()) {
-          files.add(file);
-        } 
-      }
-    }
-    return files;
+	  if ( !rawTextDirectory.exists() ) {
+		  return Collections.emptyList();
+	  }
+	  List<File> files = new ArrayList<File>();
+	  for (Integer set : patientSets) {
+		  final int setNum = set;
+		  for (File file : rawTextDirectory.listFiles(new FilenameFilter(){
+			  @Override
+			  public boolean accept(File dir, String name) {
+				  return name.contains(String.format("ID%03d", setNum));
+			  }})) {
+			  // skip hidden files like .svn
+			  if (!file.isHidden()) {
+				  files.add(file);
+			  } 
+		  }
+	  }
+	  return files;
   }
 
   @Override



Mime
View raw message