commit 67c93dd8b5710b6afacfbdf581cbbbd5c156c4fe parent e5a308e3c20df51b22b40f0b696d544558e0c8ee Author: Antoine Amarilli <a3nm@a3nm.net> Date: Sun, 27 Jul 2014 11:40:06 +0200 train diaeresis file by name Diffstat:
onepass.sh | | | 10 | ++++------ |
train_diaeresis.sh | | | 4 | ++-- |
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/onepass.sh b/onepass.sh @@ -1,22 +1,20 @@ #!/bin/bash -# read current diaeresis file on stdin and take unique prefix as $1 +# read current diaeresis file as $2 and take unique prefix as $1 # produce on stdout new diaeresis file cd "$( dirname "$0" )" NUM="$1" +DFILE="$2" +shift shift -TEMP=`mktemp` mkdir -p contexts -mv -f diaeresis.json $TEMP -cat > diaeresis.json for f in "$@" do DEST=$(echo "contexts/$f.$NUM" | sed 's!/\.\.!!g') - ./plint.py test/$f.tpl "$DEST" < test/$f + ./plint.py test/$f.tpl $DFILE "$DEST" < test/$f done -mv $TEMP diaeresis.json cat contexts/* | ./haspirater/buildtrie_list.py | ./haspirater/compresstrie.py diff --git a/train_diaeresis.sh b/train_diaeresis.sh @@ -7,6 +7,6 @@ rm -f contexts/* cp diaeresis_empty.json diaeresis0.json; for a in $(seq 0 4); do b=$(($a+1)); - ./onepass.sh $a $FILES < diaeresis${a}.json > diaeresis${b}.json; + ./onepass.sh $a diaeresis${a}.json $FILES > diaeresis${b}.json; done; -cp diaeresis5.json diaeresis.json +cat diaeresis5.json