The distributions should include launchers for Brat and Morfologik Added launcher scripts to make it easy to execute the Brat and Morfologik add-on from command line.
See issue OPENNLP-895 Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/30eb9d98 Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/30eb9d98 Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/30eb9d98 Branch: refs/heads/trunk Commit: 30eb9d98ee111eab9e1418292bfa3e52faca953f Parents: 8d0d532 Author: William Colen <[email protected]> Authored: Mon Dec 26 15:54:03 2016 -0200 Committer: William Colen <[email protected]> Committed: Mon Dec 26 15:54:03 2016 -0200 ---------------------------------------------------------------------- .../src/main/bin/brat-annotation-service | 35 +++++++++++++++ .../src/main/bin/brat-annotation-service.bat | 47 ++++++++++++++++++++ opennlp-distr/src/main/assembly/bin.xml | 14 ++++++ .../src/main/bin/opennlp-cp | 35 --------------- 4 files changed, 96 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/opennlp/blob/30eb9d98/opennlp-brat-annotator/src/main/bin/brat-annotation-service ---------------------------------------------------------------------- diff --git a/opennlp-brat-annotator/src/main/bin/brat-annotation-service b/opennlp-brat-annotator/src/main/bin/brat-annotation-service new file mode 100755 index 0000000..4b0094a --- /dev/null +++ b/opennlp-brat-annotator/src/main/bin/brat-annotation-service @@ -0,0 +1,35 @@ +#!/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. + +# Note: Do not output anything in this script file, any output +# may be inadvertantly placed in any output files if +# output redirection is used. + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + JAVACMD="$JAVA_HOME/bin/java" + else + JAVACMD="`which java`" + fi +fi + +# Might fail if $0 is a link +OPENNLP_HOME=`dirname "$0"`/.. + +$JAVACMD -Xmx1024m -cp "lib/*" opennlp.bratann.NameFinderAnnService $@ http://git-wip-us.apache.org/repos/asf/opennlp/blob/30eb9d98/opennlp-brat-annotator/src/main/bin/brat-annotation-service.bat ---------------------------------------------------------------------- diff --git a/opennlp-brat-annotator/src/main/bin/brat-annotation-service.bat b/opennlp-brat-annotator/src/main/bin/brat-annotation-service.bat new file mode 100755 index 0000000..06a626a --- /dev/null +++ b/opennlp-brat-annotator/src/main/bin/brat-annotation-service.bat @@ -0,0 +1,47 @@ +@ECHO off + +REM # Licensed to the Apache Software Foundation (ASF) under one +REM # or more contributor license agreements. See the NOTICE file +REM # distributed with this work for additional information +REM # regarding copyright ownership. The ASF licenses this file +REM # to you under the Apache License, Version 2.0 (the +REM # "License"); you may not use this file except in compliance +REM # with the License. You may obtain a copy of the License at +REM # +REM # http://www.apache.org/licenses/LICENSE-2.0 +REM # +REM # Unless required by applicable law or agreed to in writing, +REM # software distributed under the License is distributed on an +REM # # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +REM # KIND, either express or implied. See the License for the +REM # specific language governing permissions and limitations +REM # under the License. + +REM # Note: Do not output anything in this script file, any output +REM # may be inadvertantly placed in any output files if +REM # output redirection is used. +SETLOCAL + +IF "%JAVA_CMD%" == "" ( + IF "%JAVA_HOME%" == "" ( + SET JAVA_CMD=java + ) ELSE ( + REM # Keep JAVA_HOME to short-name without spaces + FOR %%A IN ("%JAVA_HOME%") DO SET JAVA_CMD=%%~sfA\bin\java + ) +) + +REM # Should work with Windows XP and greater. If not, specify the path to where it is installed. +IF "%OPENNLP_HOME%" == "" ( + SET OPENNLP_HOME=%~sp0.. +) ELSE ( + REM # Keep OPENNLP_HOME to short-name without spaces + FOR %%A IN ("%OPENNLP_HOME%") DO SET OPENNLP_HOME=%%~sfA +) + +REM # Get the library JAR file name (JIRA OPENNLP-554) +FOR %%A IN ("%OPENNLP_HOME%\lib\*.jar") DO SET JAR_FILE=%%A + +%JAVA_CMD% -Xmx1024m -jar %JAR_FILE% opennlp.bratann.NameFinderAnnService %* + +ENDLOCAL \ No newline at end of file http://git-wip-us.apache.org/repos/asf/opennlp/blob/30eb9d98/opennlp-distr/src/main/assembly/bin.xml ---------------------------------------------------------------------- diff --git a/opennlp-distr/src/main/assembly/bin.xml b/opennlp-distr/src/main/assembly/bin.xml index 4ed17f8..615c7fc 100644 --- a/opennlp-distr/src/main/assembly/bin.xml +++ b/opennlp-distr/src/main/assembly/bin.xml @@ -74,6 +74,20 @@ <directoryMode>755</directoryMode> <outputDirectory>bin</outputDirectory> </fileSet> + + <fileSet> + <directory>../opennlp-morfologik-addon/src/main/bin</directory> + <fileMode>755</fileMode> + <directoryMode>755</directoryMode> + <outputDirectory>bin</outputDirectory> + </fileSet> + + <fileSet> + <directory>../opennlp-brat-annotator/src/main/bin</directory> + <fileMode>755</fileMode> + <directoryMode>755</directoryMode> + <outputDirectory>bin</outputDirectory> + </fileSet> <fileSet> <directory>../opennlp-docs/target/docbkx/html</directory> http://git-wip-us.apache.org/repos/asf/opennlp/blob/30eb9d98/opennlp-morfologik-addon/src/main/bin/opennlp-cp ---------------------------------------------------------------------- diff --git a/opennlp-morfologik-addon/src/main/bin/opennlp-cp b/opennlp-morfologik-addon/src/main/bin/opennlp-cp deleted file mode 100755 index dff0d12..0000000 --- a/opennlp-morfologik-addon/src/main/bin/opennlp-cp +++ /dev/null @@ -1,35 +0,0 @@ -#!/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. - -# Note: Do not output anything in this script file, any output -# may be inadvertantly placed in any output files if -# output redirection is used. - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - JAVACMD="$JAVA_HOME/bin/java" - else - JAVACMD="`which java`" - fi -fi - -# Might fail if $0 is a link -OPENNLP_HOME=`dirname "$0"`/.. - -$JAVACMD -Xmx1024m -cp "lib/*" opennlp.tools.cmdline.CLI $@
