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

Update validate_data_dir.sh #4130

Merged
merged 1 commit into from Jun 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions egs/wsj/s5/utils/validate_data_dir.sh
Expand Up @@ -124,10 +124,10 @@ if [ ! -f $data/text ] && ! $no_text; then
fi

num_utts=`cat $tmpdir/utts | wc -l`
if [ -f $data/text ]; then
if ! $no_text; then
if ! $non_print; then
# compatible with bin/align-text
n_non_print=$(grep -c '[^[:print:][:space:]]' $data/text) && \
n_non_print=$(LC_ALL="C.UTF-8" grep -c '[^[:print:][:space:]]' $data/text) && \
Copy link
Contributor

Choose a reason for hiding this comment

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

this isn't working for turkish. We should use en_us.UTF-8 here. Also I suggest we make non_print as true here, so that ppl only turn this on when necessary. Otherwise failing the program even if there's one offending line is too strict.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

This has already been fixed, see #4130

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm no.. Here we are using C.UTF-8, while it's still failing for turkish characters.. en_us.UTF-8 works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you provide a test case?

Copy link
Contributor

Choose a reason for hiding this comment

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

The correct setting here is LANG=C.UTF-8. grep does not care what is the first day of the week in the locale (if the C locale has them at all). either LANG= or LC_CTYPE= is enough.

echo "$0: text contains $n_non_print lines with non-printable characters" &&\
exit 1;
fi
Expand Down