From 95b6b542c1820de54a2def7a681e8b1bca26b694 Mon Sep 17 00:00:00 2001 From: Krzysztof Jurkiewicz Date: Fri, 26 Apr 2019 13:49:10 +0200 Subject: [PATCH] awk in dockerfile --- metrics_docker.sh | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/metrics_docker.sh b/metrics_docker.sh index 7faa1ce..d3aca58 100644 --- a/metrics_docker.sh +++ b/metrics_docker.sh @@ -1,16 +1,24 @@ -while read line; do - echo "processing: $line" - echo "$line" | awk -F '\t' '{print $1}' - echo "$line" | awk -F '\t' '{print $2}' > hypothesis.txt - echo "$line" | awk -F '\t' '{print $3}' > reference.txt +# while read line; do +# echo "processing: $line" +# echo "$line" | awk -F '\t' '{print $1}' +# echo "$line" | awk -F '\t' '{print $2}' > hypothesis.txt +# echo "$line" | awk -F '\t' '{print $3}' > reference.txt +# +# awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < reference.txt > reference.trn +# awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hypothesis.txt > hypothesis.trn +# +# sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout +# +# done < wikiniews_results.tsv + + +awk -F '\t' '{print $2}' < wikiniews_results.tsv > hypothesis.txt +awk -F '\t' '{print $3}' < wikiniews_results.tsv > reference.txt awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < reference.txt > reference.trn awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hypothesis.txt > hypothesis.trn - sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout - -done < wikiniews_results.tsv - +sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout # # awk '{print gensub("^\\*\\*", "\\\\**", "g", $0) "\t(sp1_"NR")"}'\