ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From james-mas...@apache.org
Subject svn commit: r1500615 - /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/TestAttributeModels.java
Date Mon, 08 Jul 2013 09:05:28 GMT
Author: james-masanz
Date: Mon Jul  8 09:05:28 2013
New Revision: 1500615

URL: http://svn.apache.org/r1500615
Log:
new 'wrapper' based on TrainAttributeModels. these 'wrappers' are being created so don't need
a run configuration. see also AssertionConst.java

Added:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/TestAttributeModels.java
  (with props)

Added: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/TestAttributeModels.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/TestAttributeModels.java?rev=1500615&view=auto
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/TestAttributeModels.java
(added)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/TestAttributeModels.java
Mon Jul  8 09:05:28 2013
@@ -0,0 +1,51 @@
+package org.apache.ctakes.assertion.train;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.apache.ctakes.assertion.eval.AssertionEvaluation;
+import org.apache.ctakes.assertion.util.AssertionConst;
+
+import scala.actors.threadpool.Arrays;
+
+
+/**
+ * For each assertion attribute (polarity, conditional, etc), run against the test directories
+ * for that attribute, using models that are under the models-dir.
+ * Note that this uses constants within {@link AssertionConst} for the directory names.
+ */
+public class TestAttributeModels {
+
+	public static void main(String[] args) throws Exception {
+		
+		for (String attribute : AssertionConst.annotationTypes) {
+			
+			ArrayList<String> params = new ArrayList<String>();
+
+			params.add("--test-dir"); 	params.add(AssertionConst.testDirectories.get(attribute));
+			params.add("--models-dir"); params.add(AssertionConst.modelDirectory);
+			params.add("--evaluation-output-dir");	params.add(AssertionConst.evalOutputDir);
+			
+			// Build up an "ignore" string
+			for (String ignoreAttribute : AssertionConst.annotationTypes) {
+				if (!ignoreAttribute.equals(attribute)) { 
+
+					if (ignoreAttribute.equals("historyOf")) {
+						ignoreAttribute = ignoreAttribute.substring(0, ignoreAttribute.length()-2);
+					}
+
+					params.add("--ignore-" + ignoreAttribute);
+				}
+			}
+			String[] paramList = params.toArray(new String[]{});
+			
+			System.out.println(Arrays.asList(paramList).toString());
+			
+			// Run the actual assertion test on just one attribute
+			AssertionEvaluation.main( paramList );
+		}
+		
+		
+		
+	}
+}

Propchange: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/TestAttributeModels.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message