/usr/bin/irstlm is in irstlm 5.80.03-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | #!/bin/sh
# This software is released according to the Expat license below.
#
# Copyright: 2012-2013, Giulio Paci <giuliopaci@gmail.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
COMMAND="$1"
export IRSTLM=/usr/lib/irstlm
IRSTLM_PATH=/usr/lib/irstlm/bin
PATH=$IRSTLM_PATH:$PATH
get_commands()
{
ls "$IRSTLM_PATH" | while read cmnd;
do
"$IRSTLM_PATH"/"$cmnd" -h 2>&1 \
| head -n 3 \
| grep . \
;
done
echo "help - print help about commands"
}
get_help_usage()
{
local cmnd="$1"
if test x"$cmnd" = x""
then
cat<<EOF
help - print help about commands
USAGE:
help [ command ]
COMMANDS:
EOF
get_commands | sed -e 's/^/ /' | sed -e 's/[.]\(sh\|pl\) -/ -/g'
cat<<EOF
EOF
else
if [ -x "$IRSTLM_PATH"/"$cmnd" ]
then
"$IRSTLM_PATH"/"$cmnd" -h 2>&1
elif [ -x "$IRSTLM_PATH"/"$cmnd".sh ]
then
"$IRSTLM_PATH"/"$cmnd".sh -h 2>&1 | sed -e 's/\('"$cmnd"'\)[.]sh/\1/g'
elif [ -x "$IRSTLM_PATH"/"$cmnd".pl ]
then
"$IRSTLM_PATH"/"$cmnd".pl -h 2>&1 | sed -e 's/\('"$cmnd"'\)[.]pl/\1/g'
else
cat<<EOF
"$cmnd" command unsupported.
Try "$0 help" for a list of supported commands.
EOF
fi
fi
}
get_usage()
{
local cmnd="$1"
if test x"$cmnd" = x""
then
cat<<EOF
irstlm - frontend to the IRST Language Modeling toolkit
DESCRIPTION:
irstlm is a software for statistical language modeling. It
generates n-gram models that can be used on any system
supporting ARPA language model format.
USAGE:
irstlm [ command ] [ command_options ]
irstlm help [ command ]
EXAMPLES:
irstlm help
Print a brief descriprion of the available
commands.
irstlm help <command>
Print help for <command>.
irstlm <command> [ command_options ]
Executes <command> with the given options.
EOF
fi
}
if test x"$1" = x""
then
get_usage
exit
fi
shift
if test x"$COMMAND" = x"help"
then
get_help_usage "$1"
exit 0;
fi
if [ -x "$IRSTLM_PATH"/"$COMMAND" ]
then
"$IRSTLM_PATH"/"$COMMAND" "$@"
elif [ -x "$IRSTLM_PATH"/"$COMMAND".sh ]
then
"$IRSTLM_PATH"/"$COMMAND".sh "$@"
elif [ -x "$IRSTLM_PATH"/"$COMMAND".pl ]
then
"$IRSTLM_PATH"/"$COMMAND".pl "$@"
else
get_help_usage "$COMMAND"
fi
|