ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattco...@apache.org
Subject svn commit: r1438572 - /incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
Date Fri, 25 Jan 2013 16:10:43 GMT
Author: mattcoarr
Date: Fri Jan 25 16:10:43 2013
New Revision: 1438572

URL: http://svn.apache.org/viewvc?rev=1438572&view=rev
Log:
output filenames that match input filenames (not sequential file numbers)

in the initialize() method, move the logic for getting the parameter value for "setting defaults"
(true or false) outside the try catch loop for file path logic.  it was being skipped if an
exception was thrown.

Modified:
    incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java

Modified: incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java?rev=1438572&r1=1438571&r2=1438572&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
(original)
+++ incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
Fri Jan 25 16:10:43 2013
@@ -32,6 +32,7 @@ import java.util.Set;
 
 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.AnatomicalSiteMention;
@@ -193,10 +194,10 @@ public class SHARPKnowtatorXMLReader ext
   public void initialize(UimaContext aContext) throws ResourceInitializationException {
 	super.initialize(aContext);
 
-	try {
+  Boolean sd = (Boolean) aContext.getConfigParameterValue(SET_DEFAULTS);
+  setDefaults = (sd==null)? true : sd;
+  try {
 		textURIDirectory = new File( (String) aContext.getConfigParameterValue(PARAM_TEXTURI) );
-		Boolean sd = (Boolean) aContext.getConfigParameterValue(SET_DEFAULTS);
-		setDefaults = (sd==null)? true : sd;
 	} catch (NullPointerException e) {
 		textURIDirectory = null;
 	}
@@ -1602,7 +1603,9 @@ public class SHARPKnowtatorXMLReader ext
             XWriter.class,
             typeSystemDescription,
             XWriter.PARAM_OUTPUT_DIRECTORY_NAME,
-	    	"/tmp"
+	    	    "/tmp",
+	    	    XWriter.PARAM_FILE_NAMER_CLASS_NAME,
+	    	    CtakesFileNamer.class.getName()
            );
     /////////////////////////
     
@@ -1615,6 +1618,7 @@ public class SHARPKnowtatorXMLReader ext
         documentID.setDocumentID(textFile.toURI().toString());
         documentID.addToIndexes();
         engine.process(jCas);
+        documentID.setDocumentID(textFile.getName());
         xWriter.process(jCas); ///////////////////
       }
     }



Mime
View raw message