How do I set up SRG with Freeling and with LKB-FOS? I know it is working for people who already have an older version of Freeling installed along with the logon tree. But I think I (a) don’t have that old version installed; and (b) ultimately, I do not want the old version, I want the new version, and I want to update the grammar rules to work with the new version.
So suppose I have a version of Freeling installed somewhere.
How do I update the SRG/LKB script
file (or something else) in order for it to work?
In the logon version of the SRG, there is a file called logon.cfg
which is a Freeling config file, but I do not see it mentioned anywhere, this file (in any of the LKB configuration files?..) So I am not sure what to do with it and how to use it. It uses a variable called $FREELINGSHARE, which I found defined in a file called fl_initialize
which lives in my /bin directory:
##--- Get FreeLing installation from the location of this script
FREELING=$(dirname $(cd $(dirname $0) && echo $PWD))
##--- define FREELINGSHARE (if not already defined), which is used in default config files
if [ "x$FREELINGSHARE" = "x" ]; then
export FREELINGSHARE=$FREELING/share/freeling
fi
#--- set paths to libraries required to execute FreeLing
OS=`uname -s`
if [ $OS == "Linux" ]; then
export LD_LIBRARY_PATH=$FREELING/lib:$LD_LIBRARY_PATH
else
# it is a Mac
export DYLD_LIBRARY_PATH=$FREELING/lib:$DYLD_LIBRARY_PATH
fi
#--- Pass all parameters to the executable, fixing the config file path if necessary
i=1; eval arg=\${$i}
param=""
while [[ $i -le $# ]]; do
param="$param $arg"
if [ "$arg" == "-f" ]; then
let i=$i+1; eval arg=\${$i}
if [ -e $arg ]; then
param="$param $arg"
else
param="$param $FREELING/share/freeling/config/$arg"
fi
fi
let i=$i+1; eval arg=\${$i}
done
This script, in turn, is run by the analyze
script, which is the name of the command that I have to execute in order to run freeling from command line:
## Execute FreeLing environment initialization
. $(cd $(dirname $0) && echo $PWD)/fl_initialize $@
If I run Freeling from command line, by calling analyze
, it works. But if I load even the logon distribution of the SRG into LKB, it loads but does not work:
Perhaps the magic is in the final line in the LKB/script:
(initialize-sppp)
There is a Freeling-related file called sppp.dat
in the logon distribution of the SRG but I don’t know what to do with it. It does not look like an executable of any sort.
Does anyone know how this is supposed to work?