You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by se...@apache.org on 2016/11/09 23:34:57 UTC
svn commit: r1769028 - in /ctakes/trunk/ctakes-distribution/src/main/bin:
runPiperFile.bat runPiperFile.sh runctakesCPE.bat runctakesCVD.bat
Author: seanfinan
Date: Wed Nov 9 23:34:56 2016
New Revision: 1769028
URL: http://svn.apache.org/viewvc?rev=1769028&view=rev
Log:
add runPiperFile
check JAVA_HOME for CPE, CVD
Added:
ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat
ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh
Modified:
ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCPE.bat
ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCVD.bat
Added: ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat?rev=1769028&view=auto
==============================================================================
--- ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat (added)
+++ ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat Wed Nov 9 23:34:56 2016
@@ -0,0 +1,54 @@
+@ECHO OFF
+::
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements. See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership. The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+::
+::
+:: Runs the pipeline in the piper file specified by -p {piperfile}
+:: with any other provided parameters
+::
+::
+:: Requires JAVA JDK 1.8+
+::
+
+@REM Guess CTAKES_HOME if not defined
+set CURRENT_DIR=%cd%
+if not "%CTAKES_HOME%" == "" goto gotHome
+set CTAKES_HOME=%CURRENT_DIR%
+if exist "%CTAKES_HOME%\bin\runctakesCVD.bat" goto okHome
+cd ..
+set CTAKES_HOME=%cd%
+
+:gotHome
+if exist "%CTAKES_HOME%\bin\runctakesCVD.bat" goto okHome
+echo The CTAKES_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+
+:okHome
+@set PATH=%PATH%;%CTAKES_HOME%\lib\auth\x64
+@REM use JAVA_HOME if set
+if exist "%JAVA_HOME%\bin\java.exe" set PATH=%JAVA_HOME%\bin;%PATH%
+
+cd %CTAKES_HOME%
+set CLASS_PATH=%CTAKES_HOME%/desc/;%CTAKES_HOME%/resources/;%CTAKES_HOME%/lib/*
+set LOG4J_PARM=-Dlog4j.configuration=file:/%CTAKES_HOME%/config/log4j.xml
+set PIPE_RUNNER=org.apache.ctakes.core.pipeline.PiperFileRunner
+java -cp "%CLASS_PATH%" %LOG4J_PARM% -Xms512M -Xmx3g %PIPE_RUNNER% %*
+cd %CURRENT_DIR%
+
+:end
Added: ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh?rev=1769028&view=auto
==============================================================================
--- ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh (added)
+++ ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh Wed Nov 9 23:34:56 2016
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+# Runs the pipeline in the piper file specified by -p (piperfile)
+# with any other provided parameters.
+#
+# Requires JAVA JDK 1.8+
+#
+
+PRG="$0"
+while [ -h "$PRG" ]; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`/"$link"
+ fi
+done
+PRGDIR=`dirname "$PRG"`
+
+# Only set CTAKES_HOME if not already set
+[ -z "$CTAKES_HOME" ] && CTAKES_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
+
+cd $CTAKES_HOME
+java -cp $CTAKES_HOME/desc/:$CTAKES_HOME/resources/:$CTAKES_HOME/lib/* -Dlog4j.configuration=file:$CTAKES_HOME/config/log4j.xml -Xms512M -Xmx3g org.apache.ctakes.core.pipeline.PiperFileRunner "$@"
Modified: ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCPE.bat
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCPE.bat?rev=1769028&r1=1769027&r2=1769028&view=diff
==============================================================================
--- ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCPE.bat (original)
+++ ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCPE.bat Wed Nov 9 23:34:56 2016
@@ -17,7 +17,7 @@
@REM under the License.
@REM
-@REM Requires JAVA JDK 1.6+
+@REM Requires JAVA JDK 1.8+
@REM If you plan to use the UMLS Resources, set/export env variables
@REM set ctakes.umlsuser=[username], ctakes.umlspw=[password]
@REM or add the properties
@@ -39,6 +39,8 @@ echo This environment variable is needed
goto end
:okHome
+@REM use JAVA_HOME if set
+if exist "%JAVA_HOME%\bin\java.exe" set PATH=%JAVA_HOME%\bin;%PATH%
@set PATH=%PATH%;%CTAKES_HOME%\lib\auth\x64
cd %CTAKES_HOME%
java -cp "%CTAKES_HOME%/desc/;%CTAKES_HOME%/resources/;%CTAKES_HOME%/lib/*" -Dlog4j.configuration=file:/%CTAKES_HOME%/config/log4j.xml -Xms512M -Xmx3g org.apache.uima.tools.cpm.CpmFrame
Modified: ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCVD.bat
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCVD.bat?rev=1769028&r1=1769027&r2=1769028&view=diff
==============================================================================
--- ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCVD.bat (original)
+++ ctakes/trunk/ctakes-distribution/src/main/bin/runctakesCVD.bat Wed Nov 9 23:34:56 2016
@@ -38,6 +38,8 @@ echo This environment variable is needed
goto end
:okHome
+@REM use JAVA_HOME if set
+if exist "%JAVA_HOME%\bin\java.exe" set PATH=%JAVA_HOME%\bin;%PATH%
@set PATH=%PATH%;%CTAKES_HOME%\lib\auth\x64
cd %CTAKES_HOME%
java -cp "%CTAKES_HOME%/desc/;%CTAKES_HOME%/resources/;%CTAKES_HOME%/lib/*" -Dlog4j.configuration=file:/%CTAKES_HOME%/config/log4j.xml -Xms512M -Xmx3g org.apache.uima.tools.cvd.CVD