diff --git a/script_nuance/XWin Server.lnk b/script_nuance/XWin Server.lnk new file mode 100644 index 0000000..506f900 Binary files /dev/null and b/script_nuance/XWin Server.lnk differ diff --git a/script_nuance/_template.sh b/script_nuance/_template.sh new file mode 100644 index 0000000..bd9b5be --- /dev/null +++ b/script_nuance/_template.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +################################################################################ +# template for checking platform to set platform-specific environment. +################################################################################ +PLATFORM=`hostname | perl -ne 'if (/AC-/) {exec "echo aachen_linux"} elsif (/leiqin/) {exec "echo aachen_windows"} elsif (/xena|cvshost/) {exec "echo burlington_unix"}'` + +if [ $PLATFORM == 'aachen_windows' ] +then + echo "$PLATFORM: do something" +elif [ $PLATFORM == 'aachen_linux' ] +then + echo "$PLATFORM: do something" +else + echo "Unknown System: nothing has been performed!" +fi + +################################################################################ +# template for system-specific settings +################################################################################ +HOST=`/bin/hostname` +OS_TYPE=`/bin/uname -s` +OS_REL=`/bin/uname -r` +CPU=`/usr/localbin/cpu` +OS=`/usr/localbin/os` + +if [ $HOST == '???' ] +then . ~/???.sh +elif [ $HOST == '???' ] +then . ~/???.sh +else + echo "Unknown system $HOST." +fi + +#################################### +# you must use double quote around $1, because it's a shell variable and replaced by shell directly. +if [ "$1" == "" ] # it's always safer to quote variables in shell script. + +if [ condition ] +then # then must be on a seperate line! + cmds +elif [ condition ] + cmds +else + cmds +fi + +################################################################################ +#******************************************************************************* +################################################################################ + +#~/bin/csh + +################################################################################ +# template for system-specific settings +################################################################################ +set host=`/bin/hostname` +set os_type=`/bin/uname -s` +set os_rel=`/bin/uname -r` +#set cpu=`/usr/localbin/cpu` +#set os=`/usr/localbin/os` + +if ($host == "hydra") then # the then must be in the same line of if + source ~/cshrc.hydra.csh +else if ($host == "AC-Albatross") then + source ~/cshrc.ac-linux.csh +else + echo "Unknown system $host." +endif + +if ( condition ) then # then must be on the same line! + cmds +else if ( condition ) + cmds +else + cmds +endif diff --git a/script_nuance/addlibpath.csh b/script_nuance/addlibpath.csh new file mode 100644 index 0000000..6cb4bb3 --- /dev/null +++ b/script_nuance/addlibpath.csh @@ -0,0 +1,21 @@ +#!/bin/csh + +# usage: source addlibpath.csh new_path + +# this script requires a normalized $PATH: +# 1. each path except the last one must be followed by ":" without any whitespace; +# 2. each path is NOT finished by "/" +# besides, the input parameter $1 is NOT finished by "/". +# Purpose of the normalization is to match $ENV{NEWPATH}(:\|$) + +# it must be explicitly exported because Perl only add environment variables to %ENV, not those shell variables: +setenv NEWPATH $1 + +# on windows, we must use /usr/bin/perl from cygwin, because ActivePerl doesn't work on following line: +if ('no' == `/usr/bin/perl -e 'if ($ENV{LD_LIBRARY_PATH} =~ m|$ENV{NEWPATH}(:\|$)|) {exec "echo yes"} else {exec "echo no"}'`) then + if (${?LD_LIBRARY_PATH} == 1) then # you must enclose {?LD_LIBRARY_PATH}, otherwise it checks LD instead of LD_LIBRARY_PATH + setenv LD_LIBRARY_PATH ${1}:${LD_LIBRARY_PATH} # $1 must be enclosed with {}, otherwise it cannot be parsed. + else + setenv LD_LIBRARY_PATH ${1} + endif +endif diff --git a/script_nuance/addlibpath.sh b/script_nuance/addlibpath.sh new file mode 100644 index 0000000..90a9c69 --- /dev/null +++ b/script_nuance/addlibpath.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# usage: . addlibpath.sh new_path + +# this script requires a normalized $LD_LIBRARY_PATH: +# 1. each path except the last one must be followed by ":" without any whitespace; +# 2. each path is NOT finished by "/" +# besides, the input parameter $1 is NOT finished by "/". +# Purpose of the normalization is to match $ENV{NEWPATH}(:\|$) + +# it must be explicitly exported because Perl only add environment variables to %ENV, not those shell variables: +export NEWPATH=$1 +# on windows, we must use /usr/bin/perl from cygwin, because ActivePerl doesn't work on following line: +if [ 'no' == `/usr/bin/perl -e 'if ($ENV{LD_LIBRARY_PATH} =~ m|$ENV{NEWPATH}(:\|$)|) {exec "echo yes"} else {exec "echo no"}'` ] +then + if [ -z ${LD_LIBRARY_PATH} ] + then + export LD_LIBRARY_PATH=$1 + else + export LD_LIBRARY_PATH=$1:${LD_LIBRARY_PATH} + fi +fi diff --git a/script_nuance/addpath.csh b/script_nuance/addpath.csh new file mode 100644 index 0000000..d109f8d --- /dev/null +++ b/script_nuance/addpath.csh @@ -0,0 +1,16 @@ +#!/bin/csh + +# usage: source addlibpath.csh new_path + +# this script requires a normalized $PATH: +# 1. each path except the last one must be followed by ":" without any whitespace; +# 2. each path is NOT finished by "/" +# besides, the input parameter $1 is NOT finished by "/". +# Purpose of the normalization is to match $ENV{NEWPATH}(:\|$) + +# it must be explicitly exported because Perl only add environment variables to %ENV, not those shell variables: +setenv NEWPATH $1 +# on windows, we must use /usr/bin/perl from cygwin, because ActivePerl doesn't work on following line: +if ('no' == `/usr/bin/perl -e 'if ($ENV{PATH} =~ m|$ENV{NEWPATH}(:\|$)|) {exec "echo yes"} else {exec "echo no"}'`) then + setenv PATH ${1}:$PATH # $1 must be enclosed with {}, otherwise it cannot be parsed. +endif diff --git a/script_nuance/addpath.sh b/script_nuance/addpath.sh new file mode 100644 index 0000000..e870318 --- /dev/null +++ b/script_nuance/addpath.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# usage: . addpath.sh new_path + +# this script requires a normalized $PATH: +# 1. each path except the last one must be followed by ":" without any whitespace; +# 2. each path is NOT finished by "/" +# besides, the input parameter $1 is NOT finished by "/". +# Purpose of the normalization is to match $ENV{NEWPATH}(:\|$) + +# it must be explicitly exported because Perl only add environment variables to %ENV, not those shell variables: +export NEWPATH=$1 +# on windows, we must use /usr/bin/perl from cygwin, because ActivePerl doesn't work on following line: +if [ 'no' == `/usr/bin/perl -e 'if ($ENV{PATH} =~ m|$ENV{NEWPATH}(:\|$)|) {exec "echo yes"} else {exec "echo no"}'` ] +then + export PATH=$1:$PATH +fi diff --git a/script_nuance/cvsroot.bat b/script_nuance/cvsroot.bat new file mode 100644 index 0000000..7dd7e97 --- /dev/null +++ b/script_nuance/cvsroot.bat @@ -0,0 +1,48 @@ +@ IF "%1" == "" GOTO EMPTY +@ IF "%1" == "p" GOTO PRODUCT +@ IF "%1" == "s" GOTO SOLUTION +@ IF "%1" == "a" GOTO ASR +@ IF "%1" == "o" GOTO OFFICE +@ IF "%1" == "h" GOTO HOME + +:UNKNOWN +@ echo Unknown option! Nothing was configured. +@ GOTO USAGE + +:EMPTY +@ echo Empty option! Nothing was configured. +@ GOTO USAGE + +:USAGE +@ echo Usage: cvsroot [psaoh] +@ echo p, s, a for Product/Solutions/AMR +@ echo o, h for my Office/Home +@ echo Example: cvsroot o +@ GOTO END + +:PRODUCT +@ set CVSROOT=:pserver:llu@cvshost.speechworks.com:/swicvs/product +@ echo CVSROOT of Product was successfully configured. +@ GOTO END + +:SOLUTION +@ set CVSROOT=:pserver:llu@cvshost.speechworks.com:/swicvs/solutions +@ echo CVSROOT of Solutions was successfully configured. +@ GOTO END + +:ASR +@ set CVSROOT=:pserver:llu@wa-csr-cvs.wa.scansoft.com:/res/lvcsr/code/cvsroot +@ echo CVSROOT of AMR was successfully configured. +@ GOTO END + +:OFFICE +@ set CVSROOT=:ext:llu@ac-llu.nuance.com:/cygdrive/c/Home/cvsrep +@ echo CVSROOT of Office was successfully configured. +@ GOTO END + +:HOME +@ set CVSROOT=:ext:llu@nil.sytes.net:/cygdrive/r/cvsrep +@ echo CVSROOT of Home was successfully configured. +@GOTO END + +:END diff --git a/script_nuance/cvsroot.csh b/script_nuance/cvsroot.csh new file mode 100644 index 0000000..000a9fa --- /dev/null +++ b/script_nuance/cvsroot.csh @@ -0,0 +1,41 @@ +#!/bin/csh + +if ("$1" == '') then + echo "Which CVSROOT?" + echo " p for Product at :pserver:llu@cvshost.speechworks.com:/swicvs/product" + echo " s for Solution at :pserver:llu@cvshost.speechworks.com:/swicvs/solutions" + echo " a for AMR at :pserver:llu@wa-csr-cvs.wa.scansoft.com:/res/lvcsr/code/cvsroot" + echo " o for Office at :ext:llu@ac-llu.nuance.com:/cygdrive/c/Home/cvsrep" + echo " h for Home at :ext:llu@nil.sytes.net:/cygdrive/r/cvsrep" + echo -n ":" + set selection=$< +else + set selection=$1 +endif + +switch ($selection) +case p: + setenv CVSROOT ":pserver:llu@cvshost.speechworks.com:/swicvs/product" + echo "CVSROOT of Product was successfully configured." + breaksw +case s: + setenv CVSROOT ":pserver:llu@cvshost.speechworks.com:/swicvs/solutions" + echo "CVSROOT of Solution was successfully configured." + breaksw +case a: + setenv CVSROOT ":pserver:llu@wa-csr-cvs.wa.scansoft.com:/res/lvcsr/code/cvsroot" + echo "CVSROOT of AMR was successfully configured." + breaksw +case o: + setenv CVSROOT ":ext:llu@ac-llu.nuance.com:/cygdrive/c/Home/cvsrep" + echo "CVSROOT of Office was successfully configured." + breaksw +case h: + setenv CVSROOT ":ext:llu@nil.sytes.net:/cygdrive/r/cvsrep" + echo "CVSROOT of Home was successfully configured." + breaksw +default: + echo "Unknown option! Nothing was configured." + echo "Usage: . cvsroot.sh [psaoh]" + echo "Example: . ~/bin/cvsroot.csh o";; +endsw diff --git a/script_nuance/cvsroot.sh b/script_nuance/cvsroot.sh new file mode 100644 index 0000000..702c543 --- /dev/null +++ b/script_nuance/cvsroot.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +if [ "$1" == '' ] +then + echo "Which CVSROOT?" + echo " p for Product at :pserver:llu@cvshost.speechworks.com:/swicvs/product" + echo " s for Solutions at :pserver:llu@cvshost.speechworks.com:/swicvs/solutions" + echo " a for AMR at :pserver:llu@wa-csr-cvs.wa.scansoft.com:/res/lvcsr/code/cvsroot" + echo " o for Office at :ext:llu@ac-llu.nuance.com:/cygdrive/c/Home/cvsrep" + echo " h for Home at :ext:llu@nil.sytes.net:/cygdrive/r/cvsrep" + echo -n ":" + read selection +else + selection=$1 +fi + +case $selection in + p) export CVSROOT=":pserver:llu@cvshost.speechworks.com:/swicvs/product" + echo "CVSROOT of Product was successfully configured.";; + s) export CVSROOT=":pserver:llu@cvshost.speechworks.com:/swicvs/solutions" + echo "CVSROOT of Solution was successfully configured.";; + a) export CVSROOT=":pserver:llu@wa-csr-cvs.wa.scansoft.com:/res/lvcsr/code/cvsroot" + echo "CVSROOT of AMR was successfully configured.";; + o) export CVSROOT=":ext:llu@ac-llu.nuance.com:/cygdrive/c/Home/cvsrep" + echo "CVSROOT of Office was successfully configured.";; + h) export CVSROOT="ext:llu@nil.sytes.net:/cygdrive/r/cvsrep" + echo "CVSROOT of Home was successfully configured.";; + *) echo "Unknown option! Nothing was configured." + echo "Usage: . cvsroot.sh [psaoh]" + echo "Example: . ~/bin/cvsroot.sh o";; +esac diff --git a/script_nuance/exspeech.csh b/script_nuance/exspeech.csh new file mode 100644 index 0000000..d9160ac --- /dev/null +++ b/script_nuance/exspeech.csh @@ -0,0 +1,28 @@ +#!/bin/csh + +source ~/bin/platform.csh + +#if ("$1" == '') then +# echo "Which ExSpeech?" +# echo -n "Please enter a ExSpeech version, e.g. 2006-02-02: " +# set selection=$< +#else +# set selection=$1 +#endif + +echo "Use current ExSpeech version:" +set selection='current' + +# todo: check existence of osr installation! +if ("$PLATFORM" == 'aachen_windows') then + echo "ExSpeech $selection isn't implemented on Aachen Windows." +else if ("$PLATFORM" == 'aachen_linux') then + echo "ExSpeech $selection isn't implemented on Aachen Linux." +else if ("$PLATFORM" == 'burlington_linux') then + source /res/tools/ExSpeech/current/setenv.csh + echo "ExSpeech $selection was successfully configured on Burlington Linux." +else if ("$PLATFORM" == 'home_windows') then + echo "ExSpeech $selection isn't implemented on Home Windows." +else + echo "Unknown System! Nothing was configured." +endif diff --git a/script_nuance/exspeech.sh b/script_nuance/exspeech.sh new file mode 100644 index 0000000..7d491b7 --- /dev/null +++ b/script_nuance/exspeech.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +. ~/bin/platform.sh + +#if [ "$1" == '' ] then +# echo "Which ExSpeech?" +# echo -n "Please enter an ExSpeech version, e.g. 2006-02-02: " +# read selection +#else +# selection=$1 +#fi + +echo "Use current ExSpeech version:" +selection='current' + +# todo: check existence of osr installation! +if [ "$PLATFORM" == 'aachen_windows' ] +then + echo "ExSpeech $selection isn't implemented on Aachen Windows." +elif [ "$PLATFORM" == 'aachen_linux' ] +then + echo "ExSpeech $selection isn't implemented on Aachen Linux." +elif [ "$PLATFORM" == 'burlington_linux' ] +then + . /res/tools/ExSpeech/current/setenv.sh + echo "ExSpeech $selection was successfully configured on Burlington Linux." +elif [ "$PLATFORM" == 'home_windows' ] +then + echo "ExSpeech $selection isn't implemented on Home Windows." +else + echo "Unknown System! Nothing was configured." +fi diff --git a/script_nuance/gcc.csh b/script_nuance/gcc.csh new file mode 100644 index 0000000..473a7b2 --- /dev/null +++ b/script_nuance/gcc.csh @@ -0,0 +1,31 @@ +#!/bin/csh + +source ~/bin/platform.csh + +#if ("$1" == '') then +# echo "Which GCC?" +# echo -n "Please enter a GCC version, e.g. 3.4.2: " +# set selection=$< +#else +# set selection=$1 +#endif + +echo "Assume GCC 4.1.0" +set selection='4.1.0' + +# todo: check existence of osr installation! +if ($PLATFORM == 'aachen_windows') then + echo "GCC $selection is unavailable on Aachen Windows." +else if ($PLATFORM == 'aachen_linux') then + source ~/bin/addpath.csh /usr/localbin/gcc-$selection-posix-fPIC/bin + source ~/bin/addlibpath.csh /usr/localbin/gcc-$selection-posix-fPIC/lib + echo "GCC $selection was successfully configured on on Aachen Linux." +else if ($PLATFORM == 'burlington_linux') then + source ~/bin/addpath.csh /usr/local/gcc-$selection/bin + source ~/bin/addlibpath.csh /usr/local/gcc-$selection/lib + echo "GCC $selection was successfully configured on Burlington Linux." +else if ("$PLATFORM" == 'home_windows') then + echo "GCC $selection is unavailable on Home Windows." +else + echo "Unknown system! Nothing was configured." +endif diff --git a/script_nuance/gcc.sh b/script_nuance/gcc.sh new file mode 100644 index 0000000..6e49b77 --- /dev/null +++ b/script_nuance/gcc.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +. ~/bin/platform.sh + +#if [ "$1" == '' ] +#then +# echo "Which GCC?" +# echo -n "Please enter a GCC version, e.g. 3.4.2: " +# read selection +#else +# selection=$1 +#fi + +echo "Assume GCC 4.1.0" +selection='4.1.0' + +# todo: check existence of osr installation! +if [ $PLATFORM == 'aachen_windows' ] +then + echo "GCC $selection is unavailable on Aachen Windows." +elif [ $PLATFORM == 'aachen_linux' ] +then + . ~/bin/addpath.sh /usr/localbin/gcc-$selection-posix-fPIC/bin + . ~/bin/addlibpath.sh /usr/localbin/gcc-$selection-posix-fPIC/lib + echo "GCC $selection was successfully configured on on Aachen Linux." +elif [ $PLATFORM == 'burlington_linux' ] +then + . ~/bin/addpath.sh /usr/local/gcc-$selection/bin + . ~/bin/addlibpath.sh /usr/local/gcc-$selection/lib + echo "GCC $selection was successfully configured on Burlington Linux." +elif [ "$PLATFORM" == 'home_windows' ] +then + echo "GCC $selection is unavailable on Home Windows." +else + echo "Unknown system! Nothing was configured." +fi diff --git a/script_nuance/gotohost.bat b/script_nuance/gotohost.bat new file mode 100644 index 0000000..4d4e317 --- /dev/null +++ b/script_nuance/gotohost.bat @@ -0,0 +1,45 @@ +@ IF "%1" == "" GOTO EMPTY +@ IF "%1" == "home" GOTO HOME +@ IF "%1" == "office" GOTO OFFICE +@ IF "%1" == "aachen" GOTO AACHEN +@ IF "%1" == "xena" GOTO XENA +@ IF "%1" == "grid" GOTO GRID +@ IF "%1" == "menlo" GOTO MENLO + +:UNKNOWN +@ echo Unknown target! +@ ssh -C -X %1 +@ GOTO END + +:EMPTY +@ echo Empty target! +@ echo Usage: gotohost [TARGET] +@ echo TARGET = home, aachen, xena, grid, menlo +@ echo Example: gotohost grid +@ GOTO END + +:HOME +@ ssh -C -X Administrator@nil.sytes.net +@ GOTO END + +:OFFICE +@ ssh -C -X leiqin@leiqin.eu.scansoft.com +@ GOTO END + +:AACHEN +@ ssh -C -X leiqin@ac-green.eu.scansoft.com +@ GOTO END + +:XENA +@ ssh -C -X llu@xena.speechworks.com +@ GOTO END + +:GRID +@ ssh -C -X llu@grid-cnh8.grid.nuance.com +@ GOTO END + +:MENLO +@ ssh -C -X lleiqin@navy.nuance.com +@GOTO END + +:END diff --git a/script_nuance/gotohost.csh b/script_nuance/gotohost.csh new file mode 100644 index 0000000..f3187ff --- /dev/null +++ b/script_nuance/gotohost.csh @@ -0,0 +1,40 @@ +#!/bin/csh + + +if ("$1" == '') then + echo "Which target?" + echo " home" + echo " office for leiqin@leiqin.eu.scansoft.com" + echo " aachen for leiqin@ac-green.eu.scansoft.com" + echo " xena for llu@xena.speechworks.com" + echo " grid for llu@grid-cnh8.grid.nuance.com" + echo " menlo for lleiqin@navy.nuance.com" + echo -n ":" + set selection=$< +else + set selection=$1 +endif + +switch ($selection) +case home: + ssh -C -X Administrator@nil.sytes.net + breaksw +case office: + ssh -C -X leiqin@leiqin.eu.scansoft.com + breaksw +case aachen: + ssh -C -X leiqin@ac-green.eu.scansoft.com + breaksw +case xena: + ssh -C -X llu@xena.speechworks.com + breaksw +case grid: + ssh -C -X llu@grid-cnh8.grid.nuance.com + breaksw +case menlo: + ssh -C -X lleiqin@navy.nuance.com + breaksw +default: + echo "Unknown option!" + ssh -C -X $selection +endsw diff --git a/script_nuance/gotohost.sh b/script_nuance/gotohost.sh new file mode 100644 index 0000000..178fe68 --- /dev/null +++ b/script_nuance/gotohost.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ "$1" == '' ] +then + echo "Which target?" + echo " home" + echo " office for leiqin@leiqin.eu.scansoft.com" + echo " aachen for leiqin@ac-green.eu.scansoft.com" + echo " xena for llu@xena.speechworks.com" + echo " grid for llu@grid-cnh8.grid.nuance.com" + echo " menlo for lleiqin@navy.nuance.com" + echo -n ":" + read selection +else + selection=$1 +fi + +case $selection in + home) ssh -C -X Administrator@nil.sytes.net;; + office) ssh -C -X leiqin@leiqin.eu.scansoft.com;; + aachen) ssh -C -X leiqin@ac-green.eu.scansoft.com;; + xena) ssh -C -X llu@xena.speechworks.com;; + grid) ssh -C -X llu@grid-cnh8.grid.nuance.com;; + menlo) ssh -C -X lleiqin@navy.nuance.com;; + *) echo Unknown target! + ssh -C -X $selection;; +esac diff --git a/script_nuance/lrtools.bat b/script_nuance/lrtools.bat new file mode 100644 index 0000000..bc8ef03 --- /dev/null +++ b/script_nuance/lrtools.bat @@ -0,0 +1,7 @@ +@ REM set lrTools for my laptop, so that play.exe works. + +@echo off +@set SPSHAREDCOMPDIR=%HOME%\products\philips\lrtools +@set SPTOOLSDIR=%HOME%\products\philips\lrtools +@set SOUNDEDITOR=play.exe +@set PATH=%HOME%\products\philips\lrtools\bin\x86\;%PATH%; diff --git a/script_nuance/osr.bat b/script_nuance/osr.bat new file mode 100644 index 0000000..b143767 --- /dev/null +++ b/script_nuance/osr.bat @@ -0,0 +1,19 @@ +@ REM Return if option is empty or invalid: +@ IF "%1" == "" GOTO EMPTY +@ IF NOT EXIST %HOME%\products\%1 GOTO EMPTY + +@ set PATH=%HOME%\products\%1\bin;%PATH% +@ set PRODUCT_LIB_PREFIX=SR +@ set CORE_ROOT=%HOME%\products\%1 +@ set SWISDK=%HOME%\products\%1 +@ set SWISRSDK=%HOME%\products\%1 +@ set SWILicenseServerList=27000@ac-albatross;27000@juelich;27000@ac-birdie +@ GOTO END + +:EMPTY +@ echo Unknown option! Nothing was configured. +@ echo Usage: osr VERSION +@ echo Example: osr osr309 +@ GOTO END + +:END diff --git a/script_nuance/osr.csh b/script_nuance/osr.csh new file mode 100644 index 0000000..7eebe1e --- /dev/null +++ b/script_nuance/osr.csh @@ -0,0 +1,44 @@ +#!/bin/csh + +source ~/bin/platform.csh + +if ("$1" == '') then + echo "Which OSR?" + echo -n "Please enter an OSR version, e.g. osr309: " + set selection=$< +else + set selection=$1 +endif + +# todo: check existence of osr installation! +if ("$PLATFORM" == 'aachen_windows') then + source ~/bin/addpath.csh ~/products/$selection/bin + setenv PRODUCT_LIB_PREFIX SR + setenv CORE_ROOT ~/products/$selection + setenv SWISDK ~/products/$selection + setenv SWISRSDK ~/products/$selection + setenv SWILicenseServerList "27000@ac-albatross:27000@juelich:27000@ac-birdie" + echo "OSR $selection was successfully configured on Aachen Windows." +else if ("$PLATFORM" == 'aachen_linux') then + source ~/bin/addlibpath.sh /u_grid/ac-green/llu/osr/$selection/lib + source ~/bin/addpath.csh /u_grid/ac-green/llu/osr/$selection/bin + setenv PRODUCT_LIB_PREFIX SR + setenv CORE_ROOT /u_grid/ac-green/llu/osr/$selection + setenv SWISDK /u_grid/ac-green/llu/osr/$selection + setenv SWISRSDK /u_grid/ac-green/llu/osr/$selection + setenv SWILicenseServerList "27000@ac-albatross:27000@juelich:27000@ac-birdie" + echo "OSR $selection was successfully configured on Aachen Linux." +else if ("$PLATFORM" == 'burlington_linux') then + source ~/bin/addlibpath.csh /scratch/res/scratch3/llu/osr/$selection/lib + source ~/bin/addpath.csh /scratch/res/scratch3/llu/osr/$selection/bin + setenv PRODUCT_LIB_PREFIX SR + setenv CORE_ROOT /scratch/res/scratch3/llu/osr/$selection + setenv SWISDK /scratch/res/scratch3/llu/osr/$selection + setenv SWISRSDK /scratch/res/scratch3/llu/osr/$selection + setenv SWILicenseServerList "27000@beeblebrox.speechworks.com:27000@gargravarr.speechworks.com:27000@asia2.pb.scansoft.com" + echo "OSR $selection was successfully configured on Burlington Linux." +else if ("$PLATFORM" == 'home_windows') then + echo "OSR $selection is unavaible on Home Windows." +else + echo "Unknown System! Nothing was configured." +endif diff --git a/script_nuance/osr.sh b/script_nuance/osr.sh new file mode 100644 index 0000000..8102fd2 --- /dev/null +++ b/script_nuance/osr.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +. ~/bin/platform.sh + +if [ "$1" == '' ] +then + echo "Which OSR?" + echo -n "Please enter an OSR version, e.g. osr309: " + read selection +else + selection=$1 +fi + +# todo: check existence of osr installation! +if [ "$PLATFORM" == 'aachen_windows' ] +then + . ~/bin/addpath.sh ~/products/$selection/bin + export PRODUCT_LIB_PREFIX=SR + export CORE_ROOT=~/products/$selection + export SWISDK=~/products/$selection + export SWISRSDK=~/products/$selection + export SWILicenseServerList="27000@ac-albatross:27000@juelich:27000@ac-birdie" + echo "$selection was successfully configured on Aachen Windows." +elif [ "$PLATFORM" == 'aachen_linux' ] +then + . ~/bin/addlibpath.sh /u_grid/ac-green/llu/osr/$selection/lib + . ~/bin/addpath.sh /u_grid/ac-green/llu/osr/$selection/bin + export PRODUCT_LIB_PREFIX=SR + export CORE_ROOT=/u_grid/ac-green/llu/osr/$selection + export SWISDK=/u_grid/ac-green/llu/osr/$selection + export SWISRSDK=/u_grid/ac-green/llu/osr/$selection + export SWILicenseServerList="27000@ac-albatross:27000@juelich:27000@ac-birdie" + echo "$selection was successfully configured on Aachen Linux." +elif [ "$PLATFORM" == 'burlington_linux' ] +then + . ~/bin/addlibpath.sh /scratch/res/scratch3/llu/osr/$selection/lib + . ~/bin/addpath.sh /scratch/res/scratch3/llu/osr/$selection/bin + export PRODUCT_LIB_PREFIX=SR + export CORE_ROOT=/scratch/res/scratch3/llu/osr/$selection + export SWISDK=/scratch/res/scratch3/llu/osr/$selection + export SWISRSDK=/scratch/res/scratch3/llu/osr/$selection + export SWILicenseServerList="27000@beeblebrox.speechworks.com:27000@gargravarr.speechworks.com:27000@asia2.pb.scansoft.com" + echo "OSR $selection was successfully configured on Burlington Linux." +elif [ "$PLATFORM" == 'home_windows' ] +then + echo "OSR $selection is unavaible on Home Windows." +else + echo "Unknown System! Nothing was configured." +fi diff --git a/script_nuance/platform.csh b/script_nuance/platform.csh new file mode 100644 index 0000000..8f09cb4 --- /dev/null +++ b/script_nuance/platform.csh @@ -0,0 +1,7 @@ +#!/bin/csh + +set PLATFORM=`hostname | perl -ne 'if (/AC-/) {exec "echo aachen_linux"} elsif (/ac-llu/) {exec "echo aachen_windows"} elsif (/ac-nb-llu/) {exec "echo aachen_windows"} elsif (/xena|cvshost|bn-|wa-|grid-/) {exec "echo burlington_linux"} elsif (/neptune/) {exec "echo home_windows"} else {exec "echo unknown"}'` +# it must return some non-empty string for unknown hostnames, +# otherwise it makes if statement be wrong for unknown hostnames: +# if ($PLATFORM == 'somename') +# when $PLATFORM is empty string, there would be nothing to the left of ==. diff --git a/script_nuance/platform.sh b/script_nuance/platform.sh new file mode 100644 index 0000000..c298ce6 --- /dev/null +++ b/script_nuance/platform.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +PLATFORM=`hostname | perl -ne 'if (/AC-/) {exec "echo aachen_linux"} elsif (/ac-llu/) {exec "echo aachen_windows"} elsif (/ac-nb-llu/) {exec "echo aachen_windows"} elsif (/xena|cvshost|bn-|wa-|grid-/) {exec "echo burlington_linux"} elsif (/neptune/) {exec "echo home_windows"} else {exec "echo unknown"}'` +# it must return some non-empty string for unknown hostnames, +# otherwise it makes if statement be wrong for unknown hostnames: +# if [ $PLATFORM == 'somename' ] +# when $PLATFORM is empty string, there would be nothing to the left of ==. diff --git a/script_nuance/python.csh b/script_nuance/python.csh new file mode 100644 index 0000000..58d5755 --- /dev/null +++ b/script_nuance/python.csh @@ -0,0 +1,29 @@ +#!/bin/csh + +source ~/bin/platform.csh + +#if ( "$1" == '' ) then +# echo "Which Python?" +# echo -n "Please enter a Python version, e.g. 2.4: " +# set selection=$< +#else +# set selection=$1 +#endif + +echo "Currently only Python 2.4 is supported." +echo "Assume Python 2.4" +set selection='2.4' + +# todo: check existence of osr installation! +if ( $PLATFORM == 'aachen_windows' ) then + echo "Python $selection is unavailable on Aachen Windows." +else if ( $PLATFORM == 'aachen_linux' ) then + source ~/bin/addpath.csh /usr/localbin/python$selection/bin + echo "Python $selection was successfully configured on on Aachen Linux." +else if ( $PLATFORM == 'burlington_linux' ) then + echo "Python $selection is unavailable on Burlington Linux." +else if ( "$PLATFORM" == 'home_windows' ) then + echo "Python $selection is unavailable on Home Windows." +else + echo "Unknown system! Nothing was configured." +endif diff --git a/script_nuance/python.sh b/script_nuance/python.sh new file mode 100644 index 0000000..e359f2d --- /dev/null +++ b/script_nuance/python.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +. ~/bin/platform.sh + +#if [ "$1" == '' ] +#then +# echo "Which Python?" +# echo -n "Please enter a Python version, e.g. 2.4: " +# read selection +#else +# selection=$1 +#fi + +echo "Currently only Python 2.4 is supported." +echo "Assume Python 2.4" +selection='2.4' + +# todo: check existence of osr installation! +if [ $PLATFORM == 'aachen_windows' ] +then + echo "Python $selection is unavailable on Aachen Windows." +elif [ $PLATFORM == 'aachen_linux' ] +then + . ~/bin/addpath.sh /usr/localbin/python$selection/bin + echo "Python $selection was successfully configured on on Aachen Linux." +elif [ $PLATFORM == 'burlington_linux' ] +then + echo "Python $selection is unavailable on Burlington Linux." +elif [ "$PLATFORM" == 'home_windows' ] +then + echo "Python $selection is unavailable on Home Windows." +else + echo "Unknown system! Nothing was configured." +fi diff --git a/script_nuance/sge.csh b/script_nuance/sge.csh new file mode 100644 index 0000000..db26cf5 --- /dev/null +++ b/script_nuance/sge.csh @@ -0,0 +1,27 @@ +#!/bin/csh + +# test my new version. + +source ~/bin/platform.csh + +if ("$PLATFORM" == 'aachen_windows') then + echo "SGE is unavailable on Aachen Windows." +elif ("$PLATFORM" == 'my_laptop') then + echo "SGE is unavailable on my laptop." +else if ("$PLATFORM" == 'aachen_linux') then + if ( $?SGE_ROOT == 0 ) then + source /opt/sge6/default/common/settings.csh + endif + echo "SGE was successfully configured on Aachen Linux." +else if ("$PLATFORM" == 'burlington_linux') then + if ( $?SGE_ROOT == 0 ) then + source /usr/local/SGE/default/common/settings.csh + endif + # tools for Grid management: + source ~/bin/addpath.csh /res/tools/contrib/script + echo "SGE and Grid tools was successfully configured on Burlington Linux." +else if ("$PLATFORM" == 'home_windows') then + echo "SGE is unavailable on Home Windows." +else + echo "Unknown system! Nothing was configured." +endif diff --git a/script_nuance/sge.sh b/script_nuance/sge.sh new file mode 100644 index 0000000..3822029 --- /dev/null +++ b/script_nuance/sge.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +. ~/bin/platform.sh + +if [ "$PLATFORM" == 'aachen_windows' ] +then + echo "SGE is unavailable on Aachen Windows." +elif [ "$PLATFORM" == 'my_laptop' ] +then + echo "SGE is unavailable on my laptop." +elif [ "$PLATFORM" == 'aachen_linux' ] +then + if [ -z "$SGE_ROOT" ] + then + . /opt/sge6/default/common/settings.sh + fi + echo "SGE was successfully configured on Aachen Linux." +elif [ "$PLATFORM" == 'burlington_linux' ] +then + if [ -z "$SGE_ROOT" ] + then + . /usr/local/SGE/default/common/settings.sh + fi + # tools for Grid management: + . ~/bin/addpath.sh /res/tools/contrib/script + echo "SGE and Grid tools was successfully configured on Burlington Linux." +elif [ "$PLATFORM" == 'home_windows' ] +then + echo "SGE is unavailable on Home Windows." +else + echo "Unknown system! Nothing was configured." +fi diff --git a/script_nuance/tools/align.pl b/script_nuance/tools/align.pl new file mode 100644 index 0000000..1e81c25 --- /dev/null +++ b/script_nuance/tools/align.pl @@ -0,0 +1,50 @@ +#!C:/Perl/bin/perl + +if ($#ARGV==-1) { + printf "Usage: align.pl binary_alignment_filename\n"; + exit (0); +}; + +system ("align_info -labels %SWISRSDK%/config/en.sg/models/SpeechPearl.hmmlabels $ARGV[0] > $ARGV[0].txt"); +printf ("$ARGV[0] -> $ARGV[0].txt\n"); + +open(BINARY_ALIGN, "$ARGV[0].txt") or die "Cannot open file $ARGV[0].txt"; + +$count=1; + +while(){ + + s/\s+$//; + + if(/^uttname: $1/){ + close FD; + $lola = sprintf("alignments_%d.txt", $count++); + print "$' => $lola\n"; + open(FD, ">$lola") || die "cannot open $lola"; + printf FD "$'\n"; + printf FD "MillisecondsPerFrame: 10\nEND OF HEADER\n"; + printf FD "start end phoneme score -sscore score/msec\n"; + $total_score=0; + } elsif (/^ortho: /){ + printf FD "$'\n"; + } elsif(/^ label index (.*)/){ + $label=$1; + } elsif (/^ model score (.*)/){ + $score=$1; + $total_score += $score; + } elsif (/^ from time (.*)/){ + $from_time=$1; + } elsif (/^ to time (.*)/){ + $to_time=$1; + } elsif (/^ segment type (.*)/){ + if (0){ + next if $from_time == $to_time; + printf FD "%5.3f %5.3f %-20s %10.2f %10.2f %.2f\n", $from_time*100, $to_time*100, $label,$score, -$total_score, $score/($to_time -$from_time)/100; + } else { + $dscore = ($to_time==$from_time) ? 0 : $score/($to_time -$from_time)/1000; + printf FD "%5.3f %5.3f %-20s %10.2f %10.2f %.2f\n", $from_time, $to_time, $label,$score, -$total_score, $dscore; + } + } +} + +exit 0; diff --git a/script_nuance/tools/check_existence_of_listed_files.pl b/script_nuance/tools/check_existence_of_listed_files.pl new file mode 100644 index 0000000..708a83e --- /dev/null +++ b/script_nuance/tools/check_existence_of_listed_files.pl @@ -0,0 +1,22 @@ +if ($ARGV[0] =~ m|^\s*$|) +{ + print "Check existence of listed sound files.\n"; + print "Usage: perl $0 FILE_LIST\n"; + print "Example: perl $0 corpus.list\n"; + exit 0; +} + +open LIST, "$ARGV[0]" or die; + +open REPORT, ">$ARGV[0].inexistent" or die; + +while () +{ + if (m|\s*([^\s]+\.(ulaw\|wav))\s*|) + { + if (not (-e $1)) + { + print REPORT "$1\n"; + } + } +} diff --git a/script_nuance/tools/convert_summary_for_excel.pl b/script_nuance/tools/convert_summary_for_excel.pl new file mode 100644 index 0000000..81c2bd0 --- /dev/null +++ b/script_nuance/tools/convert_summary_for_excel.pl @@ -0,0 +1,21 @@ + +open(SUM, "$ARGV[0]"); +open(EXCEL, ">". "$ARGV[0].excel"); + +if ($ARGV[0] eq '') +{ + print "Converting summary file $ARGV[0] to excel format.\n"; + print "Usage: perl $0 SUMMARY_FILE\n"; + exit; +} + +while() +{ + chomp($_); + $_ =~ s/^ +//g; + $_ =~ s/ +$//g; + $_ =~ s/ +/ /g; + $_ =~ s/ /\t/g; + $_ =~ s/%//g; + print EXCEL $_."\n"; +} diff --git a/script_nuance/tools/copy_NIST_soundfile_as_ulaw_alaw_from_script.pl b/script_nuance/tools/copy_NIST_soundfile_as_ulaw_alaw_from_script.pl new file mode 100644 index 0000000..78b9091 --- /dev/null +++ b/script_nuance/tools/copy_NIST_soundfile_as_ulaw_alaw_from_script.pl @@ -0,0 +1,62 @@ +$scriptfile = $ARGV[0]; +open (SCR, $scriptfile); +while() +{ + chomp($_); + $_ =~ s/ +$//; + $startwriting = 0; + if(($_ =~ /^recognize/)&&($_ =~ /\.wav/)) + { + @parts = split(/ /, $_); + $soundFile = $parts[1]; + open(WAV,$soundFile) || next; +# die "cannot open $soundFile: $1"; +# open(WAV,$soundFile) || die; + binmode WAV; + + # get first 4 Bytes + read WAV,$rawstring, 4; + $signature = unpack("a4",$rawstring); + + if ($signature eq "NIST") + { + print "$soundFile has a sphere header and is converted to ulaw!\n"; + $input = $soundFile; + $input_base = substr($input, 0 ,-4); + open (INPUT, $input); + binmode INPUT; + while ($line = ) + { + if($startwriting == 1) + { + $line =~ s/^ +//; #remove rest of header (spaces) + $startwriting = 2; + $output = $input_base . ".". $ext; + open(OUTPUT, ">". $output) or die; + binmode OUTPUT; + } + elsif($startwriting == 2) + { + print OUTPUT $line; + } + elsif($line =~ /end_head/) + { + $startwriting = 1; #read lines until end_head statement is found. + } + else + { + if($line =~ /s4 alaw/) + { + $ext = "alaw"; + print $ext."\n"; + } + elsif($line =~ /s4 ulaw/) + { + $ext = "ulaw"; + print $ext."\n"; + } + } + } + } + } +} diff --git a/script_nuance/tools/differ_accuracy.csh b/script_nuance/tools/differ_accuracy.csh new file mode 100644 index 0000000..f0f8b88 --- /dev/null +++ b/script_nuance/tools/differ_accuracy.csh @@ -0,0 +1,27 @@ +#!/bin/csh + +if ("$1" == '') then + echo "Please enter the first absolute path with file prefix:" + set first=$< +else + set first=$1 +endif + +if ("$2" == '') then + echo "Please enter the second absolute path with file prefix:" + set second=$< +else + set second=$2 +endif + +if ("$3" == '') then + echo "Please enter the absolute path with file prefix of diff results:" + set diff=$< +else + set diff=$3 +endif + +perl /users/llu/scratch/OSR_accuracy/diff_osr_sum.pl $first.sum $second.sum >! $diff.sum +echo "$first.sum vs. $second.sum => $diff.sum" +perl /users/llu/scratch/OSR_accuracy/diff_osr_wer.pl $first.wer $second.wer >! $diff.wer +echo "$first.wer vs. $second.wer => $diff.wer" diff --git a/script_nuance/tools/favorites2html.pl b/script_nuance/tools/favorites2html.pl new file mode 100644 index 0000000..3cb1409 --- /dev/null +++ b/script_nuance/tools/favorites2html.pl @@ -0,0 +1,31 @@ +use File::Find; +use File::Copy; + +@files = glob "$ARGV[0]/*"; + +open XML, ">Favorites.html" or die; +#print XML "\n\n"; + +foreach $file (@files) +{ + if (-f $file) + { + open URL, "$file" or die; + $url = ''; + while () + { + if (m|URL=(.*)|) + { + $url = $1; + last; + } + } + $file =~ s|Favorites/||; + $file =~ s|\.url||; + $url =~ s|&|&|g; + print XML "$file
\n"; + close URL; + } +} + +#print XML "
\n\n"; diff --git a/script_nuance/tools/gather_transcription_from_listfile.pl b/script_nuance/tools/gather_transcription_from_listfile.pl new file mode 100644 index 0000000..432185d --- /dev/null +++ b/script_nuance/tools/gather_transcription_from_listfile.pl @@ -0,0 +1,25 @@ +print "Usage: perl $0 transcription_file path_prefix output_file\n"; +print "Example: perl $0 /direct/datadigest/en_sg/ives/000.txt /direct/datadigest/en_sg/ives/calls/ ~/ives.list\n"; + +open TRAN, $ARGV[0] or die "Cannot open transcription file $ARGV[0] for read.\n"; +open CORPUS, ">>$ARGV[2]" or die "Cannot open corpus file $ARGV[1] for write.\n"; + +if ($ARGV[1] =~ m|/$|) # the parameter "path_prefix" is ended with / +{ + $prefix = $ARGV[1]; +}else +{ + $prefix = "$ARGV[1]/"; +} + +while () +{ + chomp; + m|([^ ]+)\s+(.*)|; + if ($1 =~ m|\.info$|) + { + print CORPUS "new_speaker\n"; + next; + } + print CORPUS "$prefix$1.ulaw\t$2\n"; +} diff --git a/script_nuance/tools/gather_transcription_from_wordsfile.pl b/script_nuance/tools/gather_transcription_from_wordsfile.pl new file mode 100644 index 0000000..d2893ca --- /dev/null +++ b/script_nuance/tools/gather_transcription_from_wordsfile.pl @@ -0,0 +1,35 @@ +print "Usage: perl $0 transcription_dir path_prefix output_file\n"; +print "Example: perl $0 /direct/datadigest/read_English_SG/gitm/transcription /direct/datadigest/read_English_SG/gitm/calls/ ~/gitm.list\n"; + +use File::Find; +use File::Copy; + +open CORPUS, ">$ARGV[2]" or die "Cannot open corpus file $ARGV[1] for write.\n"; + +if ($ARGV[1] =~ m|/$|) # the parameter "path_prefix" is ended with / +{ + $prefix = $ARGV[1]; +}else +{ + $prefix = "$ARGV[1]/"; +} + +@dirs = ($ARGV[0]); + +find ( {wanted => \&wanted}, + @dirs ); + +sub wanted +{ + if (m|^([a-zA-Z0-9_]+)_(utt\d+)\.words$|) + { + $folder = $1; + $utt = $2; + $folder =~ m|^[A-Za-z]+(\d\d\d)|; + $group = $1; # usually it's 000, but not always. So $group need be extracted. + open WORDS, "$_" or die "Cannot open words file $_\n"; + $words = ; + chomp ($words); + print CORPUS "$prefix$group/$folder/${folder}_${utt}.ulaw\t$words\n"; + } +} diff --git a/script_nuance/tools/lyre.bat b/script_nuance/tools/lyre.bat new file mode 100644 index 0000000..8d99296 --- /dev/null +++ b/script_nuance/tools/lyre.bat @@ -0,0 +1,2 @@ +set TCLLIBPATH=C:/Programs/Lyre/tclpkg +C:/Programs/Lyre/bin/wish80.exe C:/Programs/Lyre/bin/lyre.tcl %1 %2 %3 %4 %5 diff --git a/script_nuance/tools/lyrepipe.bat b/script_nuance/tools/lyrepipe.bat new file mode 100644 index 0000000..2a712d8 --- /dev/null +++ b/script_nuance/tools/lyrepipe.bat @@ -0,0 +1,3 @@ +set TCLLIBPATH=C:/Programs/Lyre/tclpkg +C:/Programs/Lyre/bin/wish80.exe C:/Programs/Lyre/bin/lyrepipe.tcl + diff --git a/script_nuance/tools/lyretest.bat b/script_nuance/tools/lyretest.bat new file mode 100644 index 0000000..884943a --- /dev/null +++ b/script_nuance/tools/lyretest.bat @@ -0,0 +1,3 @@ +set TCLLIBPATH=C:/Programs/Lyre/tclpkg + +C:/Programs/Lyre/bin/wish80.exe C:/Programs/Lyre/bin/lyre.tcl C:/Programs/Lyre/examples/126-20040812084228.ulaw --l C:/Programs/Lyre/examples/126-20040812084228.1 --l C:/Programs/Lyre/examples/126-20040812084228.0 diff --git a/script_nuance/tools/nacc_summary.csh b/script_nuance/tools/nacc_summary.csh new file mode 100644 index 0000000..50c09c3 --- /dev/null +++ b/script_nuance/tools/nacc_summary.csh @@ -0,0 +1,29 @@ +#!/bin/csh + +echo "Usage: source nacc_summary.csh lg.co 1st_result_set [2nd_result_set]" + +setenv OSRACCDIR /scratch/res/work/Quantum/llu/nacc +setenv CFG $OSRACCDIR/$1/cfg/BASELINE.cfg + +perl $OSRACCDIR/script/summarize_proton.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $CFG -output $2/summary.proton proton $2 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl $2/summary.proton +echo Generated $2/summary.proton +perl $OSRACCDIR/script/proton_wer.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $CFG -output $2/summary.wer proton $2 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl $2/summary.wer +echo Generated $2/summary.wer + +# for variable $3, it doesn't work to use $?3 for test existence. +if ($3 != '') then + perl $OSRACCDIR/script/summarize_proton.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $CFG -output $3/summary.proton proton $3 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl $3/summary.proton + echo Generated $3/summary.proton + perl $OSRACCDIR/script/proton_wer.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $CFG -output $3/summary.wer proton $3 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl $3/summary.wer + echo Generated $3/summary.wer + + perl $OSRACCDIR/script/summarize_proton.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $CFG -output ./compare.summary.proton proton1 $2 proton2 $3 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl ./compare.summary.proton + echo Generated ./compare.summary.proton + perl $OSRACCDIR/script/proton_wer.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $CFG -output ./compare.summary.wer proton1 $2 proton2 $3 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl ./compare.summary.wer + echo Generated ./compare.summary.wer + + perl $OSRACCDIR/script/diff_osr_sum.pl $2/summary.proton $3/summary.proton >! ./diff.summary; perl ~/bin/tools/convert_summary_for_excel.pl ./diff.summary + echo "Generated ./diff.summary from $2 vs $3 /summary.proton" + perl $OSRACCDIR/script/diff_osr_wer.pl $2/summary.wer $3/summary.wer >! ./diff.wer; perl ~/bin/tools/convert_summary_for_excel.pl ./diff.wer + echo "Generated ./diff.wer from $2 vs $3 /summary.wer" +endif diff --git a/script_nuance/tools/nacc_summary.sh b/script_nuance/tools/nacc_summary.sh new file mode 100644 index 0000000..3b7c904 --- /dev/null +++ b/script_nuance/tools/nacc_summary.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +echo "Usage: source nacc_summary.csh 1st_result_set [2nd_result_set]" + +export LLUNACCDIR=/scratch/res/work/Quantum/llu/nacc +export LLUCFG=/scratch/res/work/Quantum/llu/nacc/zh.tw/cfg/BASELINE.cfg + +perl $LLUNACCDIR/script/summarize_proton.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $LLUCFG -output $1/summary.proton proton $1 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl $1/summary.proton +echo Generated $1/summary.proton +perl $LLUNACCDIR/script/proton_wer.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $LLUCFG -output $1/summary.wer proton $1 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl $1/summary.wer +echo Generated $1/summary.wer + +if [ ! -z "$2" ] +then + perl $LLUNACCDIR/script/summarize_proton.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $LLUCFG -output $2/summary.proton proton $2 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl $2/summary.proton + echo Generated $2/summary.proton + perl $LLUNACCDIR/script/proton_wer.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $LLUCFG -output $2/summary.wer proton $2 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl $2/summary.wer + echo Generated $2/summary.wer + + perl $LLUNACCDIR/script/summarize_proton.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $LLUCFG -output ./compare.summary.proton proton1 $1 proton2 $2 > /dev/null; perl ~/bin/tools/convert_summary_for_excel.pl ./compare.summary.proton + echo Generated ./compare.summary.proton + perl $LLUNACCDIR/script/proton_wer.pl -printinvocab -normalizeCpu -runtest proton -useGroup proton -meanByTestset -config $LLUCFG -output ./compare.summary.wer proton1 $1 proton2 $2 >/dev/null; perl ~/bin/tools/convert_summary_for_excel.pl ./compare.summary.wer + echo Generated ./compare.summary.wer + + perl $LLUNACCDIR/script/diff_osr_sum.pl $1/summary.proton $2/summary.proton >! ./diff.summary; perl ~/bin/tools/convert_summary_for_excel.pl ./diff.summary + echo "Generated ./diff.summary from $1 vs $2 /summary.proton" + perl $LLUNACCDIR/script/diff_osr_wer.pl $1/summary.wer $2/summary.wer >! ./diff.wer; perl ~/bin/tools/convert_summary_for_excel.pl ./diff.wer + echo "Generated ./diff.wer from $1 vs $2 /summary.wer" +fi diff --git a/script_nuance/tools/rem-token.pl b/script_nuance/tools/rem-token.pl new file mode 100644 index 0000000..25b1f57 --- /dev/null +++ b/script_nuance/tools/rem-token.pl @@ -0,0 +1,84 @@ +##################################################################################################################################### +# Script to remove DM-related tokens that cause log not to load into OSI due to max nested levels. +# The SWIdmst and SWIphnd tokens will be replaced with SWIprst to print the relevant information +##################################################################################################################################### + +#!/usr/bin/perl -w +use strict; +use Getopt::Long; + +my ($help, $inputfile, $outputfile); +GetOptions ('-help' => \$help, + '-h' => \$help, + '-input=s' => \$inputfile, + '-output=s' => \$outputfile + ); + +if ($help) { + die("\nUsage: perl $0 [-help] -input -output \n"); } +if ($inputfile eq "" || $outputfile eq "" ) { + die("\nUsage: perl $0 [-help] -input -output \n"); } + + +open( INPUT_FILE, "< $inputfile" ) #open input file for reading; + or die( "Cannot open input file \"$inputfile\" : $!" ); +open( OUTPUT_FILE, ">$outputfile" ) #open output file for writing; + or die( "Cannot open output file \"$outputfile\" : $!"); + +#my $type = "APNM"; +#my $channum = ""; +#my $orgchantext = "phone.-1.mps.-1.chan"; + + while ( my $string = ) { + chomp($string); +# my $outputstring = $string; +# Replace the Problematic SWIdmst and SWIdmnd with SWIprst to print the relevant information + if ( $string =~ m/SWIdmst/ || $string =~ m/SWIdmnd/ + || $string =~ m/SWIphst/ || $string =~ m/SWIphnd/ + || $string =~ m/SWIstst/ || $string =~ m/SWIstnd/) { +# print ("$string\n" ); + # SWIdmst + if ( $string =~ m/SWIdmst/ ) { + $string =~ s/SWIdmst/SWIprst/; + $string =~ s/DMTP=/PRNM=/; + $string =~ s/DMNM=/PRTX=/; + print (OUTPUT_FILE "$string\n" ); + } + # SWIphnd - use this instead of SWIdmnd since it has HYPO of DTMF + if ( $string =~ m/SWIphnd/ ) { + $string =~ s/SWIphnd/SWIprst/; + $string =~ s/TSTT=/PRNM=/; + $string =~ s/MODE=/PRTX=|UCPU".$mid; +# my $newstring = $pre.">|UCPU".$mid; + + print (OUTPUT_FILE "$newstring\n" ); + } + # SWIdmnd +# if ( $string =~ m/SWIdmnd/ ) { +# $string =~ s/SWIdmnd/SWIprst/; +# $string =~ s/TSTT=/PRNM=/; +# $string =~ s/TRTT=/PRTX=/; +# print (OUTPUT_FILE "$string\n" ); +# } + } + else { + print (OUTPUT_FILE "$string\n" ); + } +#endif + + } #end of WHILE; + +#close the Input and Output files; +close( INPUT_FILE ) + or die( "Cannot close \"$inputfile\" : $!" ); +close( OUTPUT_FILE ) + or die( "Cannot close \"$outputfile\" : $!" ); + +print "COMPLETE\n\n\n\n"; + + +##################################################################################################################################### diff --git a/script_nuance/tools/script2xml.pl b/script_nuance/tools/script2xml.pl new file mode 100644 index 0000000..904c615 --- /dev/null +++ b/script_nuance/tools/script2xml.pl @@ -0,0 +1,32 @@ +open SCRIPT, "$ARGV[0]" or die; +open XML, ">$ARGV[0].xml" or die; + +print XML < + + + + SWI_meaning = ITEMS.V; + + + +xmlhead + +while (