~domy/domyce/trunk

« back to all changes in this revision

Viewing changes to lib/corpusfg/demo-2.sh

  • Committer: Tom Hoar
  • Date: 2012-10-23 10:19:44 UTC
  • Revision ID: tahoar@library1-20121023101944-ewbsdg27w86qdutw
demo script updates to support path changes for DoMT

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
usage(){
23
23
        cat <<- HELP
24
24
        Usage: ${0##*/} [OPTION...]
25
 
        Runs the second demo wizard
 
25
        Run the second demo wizard
26
26
        
27
27
        Options:
28
28
          -c       continue without pausing to read prompts
54
54
        echo "$cfgm not found."
55
55
        exit 1
56
56
        fi
 
57
[ -f "$HOME/domy/$BASE.ini" ] && userfiles=$HOME/domy
 
58
[ -f "$HOME/domt/$BASE.ini" ] && userfiles=$HOME/domt
57
59
 
58
60
time_bin=`which time`
59
61
time_prefix=""
62
64
        fi
63
65
 
64
66
# set graphs and rootfolder values using ini file if available
65
 
graphs=$HOME/domy/graphs-ce
66
 
plugins=$HOME/domy/plugins
 
67
graphs=$userfiles/graphs-ce
 
68
plugins=$userfiles/plugins
67
69
rootfolder=$(dirname $(dirname ${DOMY}))/share/corpusfg
68
70
if [ ! -d "$(dirname $(dirname ${DOMY}))/share/corpusfg" ] ; then
69
71
        rootfolder=$(dirname $(dirname ${DOMY}))/share/domy
70
72
        fi
71
 
if [ -f "$HOME/domy/$BASE.ini" ] ; then
 
73
if [ -f "$userfiles/$BASE.ini" ] ; then
72
74
        while read line ; do
73
75
                [[ "${line}" =~ "=" ]] && eval "${line// /}" 2>/dev/null
74
 
                done < "$HOME/domy/$BASE.ini"
 
76
                done < "$userfiles/$BASE.ini"
75
77
        fi
76
78
 
77
79
graphsexist=0
302
304
        if [[ ! "${args[@]}" =~ "-s" ]]; then
303
305
                cp "$graphs/train/config.ini" $graphs/train/.config.ini.tmp
304
306
                cp "$graphs/train/Demonstrate complete training and tuning with micro nl-en corpus.conf" $graphs/train/config.ini
305
 
                [ -n "${time_prefix}" ] && time_prefix="${time_bin} -po $HOME/domy/time-micro.log "
 
307
                [ -n "${time_prefix}" ] && time_prefix="${time_bin} -po $userfiles/time-micro.log "
306
308
                ${time_prefix} python $cfgm -v train
307
309
                result=$?
308
310
                mv $graphs/train/.config.ini.tmp $graphs/train/config.ini
490
492
        if [[ ! "${args[@]}" =~ "-s" ]]; then
491
493
                cp "$graphs/train/config.ini" $graphs/train/.config.ini.tmp
492
494
                cp "$graphs/train/Demonstrate complete training and tuning with demo nl-en corpus.conf" $graphs/train/config.ini
493
 
                [ -n "${time_prefix}" ] && time_prefix="${time_bin} -po $HOME/domy/time-demo.log "
 
495
                [ -n "${time_prefix}" ] && time_prefix="${time_bin} -po $userfiles/time-demo.log "
494
496
                ${time_prefix} python $cfgm -v train
495
497
                result=$?
496
498
                mv $graphs/train/.config.ini.tmp $graphs/train/config.ini