Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the gawk-specific feature problems in prepare dict scripts. #1147

Merged
merged 4 commits into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions egs/aspire/s5/local/fisher_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ srcdict=$srcdir/swb_ms98_transcriptions/sw-ms98-dict.text

#(2a) Dictionary preparation:
# Pre-processing (Upper-case, remove comments)
awk 'BEGIN{getline}($0 !~ /^#/) {$0=toupper($0); print}' \
$srcdict | sort | awk '($0 !~ /^[:space:]*$/) {print}' \
> $dir/lexicon1.txt || exit 1;

grep -v '^#' $srcdict | tr '[a-z]' '[A-Z]' | awk 'NF>0' | sort > $dir/lexicon1.txt || exit 1;

cat $dir/lexicon1.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v SIL > $dir/nonsilence_phones.txt || exit 1;
Expand Down
5 changes: 1 addition & 4 deletions egs/fisher_english/s5/local/fisher_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ srcdict=$srcdir/swb_ms98_transcriptions/sw-ms98-dict.text

#(2a) Dictionary preparation:
# Pre-processing (Upper-case, remove comments)
awk 'BEGIN{getline}($0 !~ /^#/) {$0=toupper($0); print}' \
$srcdict | sort | awk '($0 !~ /^[:space:]*$/) {print}' \
> $dir/lexicon1.txt || exit 1;

grep -v '^#' $srcdict | tr '[a-z]' '[A-Z]' | awk 'NF>0' | sort > $dir/lexicon1.txt || exit 1;

cat $dir/lexicon1.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v SIL > $dir/nonsilence_phones.txt || exit 1;
Expand Down
5 changes: 1 addition & 4 deletions egs/fisher_swbd/s5/local/fisher_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ patch <local/dict.patch $dir/lexicon0.txt || exit 1;

#(2a) Dictionary preparation:
# Pre-processing (Upper-case, remove comments)
awk 'BEGIN{getline}($0 !~ /^#/) {print}' \
$dir/lexicon0.txt | sort | awk '($0 !~ /^[[:space:]]*$/) {print}' \
> $dir/lexicon1_swbd.txt || exit 1;

grep -v '^#' $dir/lexicon0.txt | awk 'NF>0' | sort > $dir/lexicon1_swbd.txt || exit 1;

cat $dir/lexicon1_swbd.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v SIL > $dir/nonsilence_phones_msu.txt || exit 1;
Expand Down
5 changes: 1 addition & 4 deletions egs/fisher_swbd/s5/local/fisher_swbd_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ patch <local/dict.patch $dir/lexicon0.txt || exit 1;

#(2a) Dictionary preparation:
# Pre-processing (Upper-case, remove comments)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plese remove the 'Upper-case' comment here since it's not being done.

awk 'BEGIN{getline}($0 !~ /^#/) {print}' \
$dir/lexicon0.txt | sort | awk '($0 !~ /^[[:space:]]*$/) {print}' \
> $dir/lexicon1_swbd.txt || exit 1;

grep -v '^#' $dir/lexicon0.txt | awk 'NF>0' | sort > $dir/lexicon1_swbd.txt || exit 1;

cat $dir/lexicon1_swbd.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v SIL > $dir/nonsilence_phones_msu.txt || exit 1;
Expand Down
5 changes: 1 addition & 4 deletions egs/fisher_swbd/s5/local/swbd1_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ srcdict=$srcdir/swb_ms98_transcriptions/sw-ms98-dict.text

#(2a) Dictionary preparation:
# Pre-processing (Upper-case, remove comments)
awk 'BEGIN{getline}($0 !~ /^#/) {$0=tolower($0); print}' \
$srcdict | sort | awk '($0 !~ /^[:space:]*$/) {print}' \
> $dir/lexicon1.txt || exit 1;

grep -v '^#' $srcdict | tr '[a-z]' '[A-Z]' | awk 'NF>0' | sort > $dir/lexicon1.txt || exit 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment said 'Upper-case' but the code was actually lower-casing. So please lower-case instead, and change the comment. See if there are similar issues elsewhere.


cat $dir/lexicon1.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v sil > $dir/nonsilence_phones.txt || exit 1;
Expand Down
5 changes: 1 addition & 4 deletions egs/sre10/v1/local/dnn/fisher_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ srcdict=$srcdir/swb_ms98_transcriptions/sw-ms98-dict.text

#(2a) Dictionary preparation:
# Pre-processing (Upper-case, remove comments)
awk 'BEGIN{getline}($0 !~ /^#/) {$0=toupper($0); print}' \
$srcdict | sort | awk '($0 !~ /^[:space:]*$/) {print}' \
> $dir/lexicon1.txt || exit 1;

grep -v '^#' $srcdict | tr '[a-z]' '[A-Z]' | awk 'NF>0' | sort > $dir/lexicon1.txt || exit 1;

cat $dir/lexicon1.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v SIL > $dir/nonsilence_phones.txt || exit 1;
Expand Down
5 changes: 1 addition & 4 deletions egs/swbd/s5/local/swbd1_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ srcdict=$srcdir/swb_ms98_transcriptions/sw-ms98-dict.text

#(2a) Dictionary preparation:
# Pre-processing (Upper-case, remove comments)
awk 'BEGIN{getline}($0 !~ /^#/) {$0=tolower($0); print}' \
$srcdict | sort | awk '($0 !~ /^[[:space:]]*$/) {print}' \
> $dir/lexicon1.txt || exit 1;

grep -v '^#' $srcdict | tr '[a-z]' '[A-Z]' | awk 'NF>0' | sort > $dir/lexicon1.txt || exit 1;

cat $dir/lexicon1.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v sil > $dir/nonsilence_phones.txt || exit 1;
Expand Down
5 changes: 1 addition & 4 deletions egs/swbd/s5/local/swbd_p1_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ srcdict=$srcdir/swb_ms98_transcriptions/sw-ms98-dict.text

#(2a) Dictionary preparation:
# Pre-processing (Upper-case, remove comments)
awk 'BEGIN{getline}($0 !~ /^#/) {$0=toupper($0); print}' \
$srcdict | sort | awk '($0 !~ /^[:space:]*$/) {print}' \
> $dir/lexicon1.txt || exit 1;

grep -v '^#' $srcdict | tr '[a-z]' '[A-Z]' | awk 'NF>0' | sort > $dir/lexicon1.txt || exit 1;

cat $dir/lexicon1.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v SIL > $dir/nonsilence_phones.txt || exit 1;
Expand Down
4 changes: 1 addition & 3 deletions egs/swbd/s5b/local/swbd1_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ patch <local/dict.patch $dir/lexicon0.txt || exit 1;

#(2a) Dictionary preparation:
# Pre-processing (lower-case, remove comments)
awk 'BEGIN{getline}($0 !~ /^#/) {$0=tolower($0); print}' \
$srcdict | sort | awk '($0 !~ /^[[:space:]]*$/) {print}' \
> $dir/lexicon1.txt || exit 1;
grep -v '^#' $srcdict | tr '[a-z]' '[A-Z]' | awk 'NF>0' | sort > $dir/lexicon1.txt || exit 1;


cat $dir/lexicon1.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
Expand Down
3 changes: 1 addition & 2 deletions egs/swbd/s5c/local/swbd1_prepare_dict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ cp $srcdict $dir/lexicon0.txt || exit 1;
patch <local/dict.patch $dir/lexicon0.txt || exit 1;

#(2a) Dictionary preparation:
# Pre-processing (remove comments, remove empty lines)
# Pre-processing (Upper-case, remove comments)
grep -v '^#' $dir/lexicon0.txt | awk 'NF>0' | sort > $dir/lexicon1.txt || exit 1;


cat $dir/lexicon1.txt | awk '{ for(n=2;n<=NF;n++){ phones[$n] = 1; }} END{for (p in phones) print p;}' | \
grep -v sil > $dir/nonsilence_phones.txt || exit 1;

Expand Down