Commit d772b2a9 authored by Jan Trmal's avatar Jan Trmal
Browse files

(trunk) Fix issue when the lines wouldn't be random enough. WARNING: this...

(trunk) Fix issue when the lines wouldn't be random enough. WARNING: this patch will cause shuffle_list.pl working in different way, i.e. it will produce differently shuffled lines! 

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@5153 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 1b387129
......@@ -33,6 +33,12 @@ if (@ARGV > 1 || $ARGV[0] =~ m/^-.+/) { # >1 args, or an option we
exit(1);
}
@lines = <>;
@lines = sort { rand() <=> rand() } @lines;
print @lines;
@lines;
while (<>) {
push @lines, [ (rand(), $_)] ;
}
@lines = sort { $a->[0] cmp $b->[0] } @lines;
foreach $l (@lines) {
print $l->[1];
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment