Return-Path: X-Original-To: apmail-ctakes-commits-archive@www.apache.org Delivered-To: apmail-ctakes-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3001710014 for ; Mon, 8 Jul 2013 09:05:53 +0000 (UTC) Received: (qmail 62567 invoked by uid 500); 8 Jul 2013 09:05:53 -0000 Delivered-To: apmail-ctakes-commits-archive@ctakes.apache.org Received: (qmail 62537 invoked by uid 500); 8 Jul 2013 09:05:52 -0000 Mailing-List: contact commits-help@ctakes.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ctakes.apache.org Delivered-To: mailing list commits@ctakes.apache.org Received: (qmail 62530 invoked by uid 99); 8 Jul 2013 09:05:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jul 2013 09:05:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jul 2013 09:05:50 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E08C1238897A; Mon, 8 Jul 2013 09:05:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@ctakes.apache.org From: james-masanz@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130708090528.E08C1238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 params = new ArrayList(); + + 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