From 2a8514f77d8a81263d273e1cdda440451e422882 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 23 Feb 2012 16:45:36 +0100 Subject: [PATCH] tools/pattern_bayes_gen.sh: Allow pattern harvesting from stdin --- tools/pattern_bayes_gen.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/pattern_bayes_gen.sh b/tools/pattern_bayes_gen.sh index d37f744..1d00293 100755 --- a/tools/pattern_bayes_gen.sh +++ b/tools/pattern_bayes_gen.sh @@ -1,7 +1,8 @@ #!/bin/sh # pattern_bayes_gen: Generate pattern probability table from a SGF collection +# (or stdin GTP stream). -(for i in "$@"; do echo $i >&2; tools/sgf2gtp.pl <$i; done) | +(if [ x"$1" = x"-" ]; then cat; else for i in "$@"; do echo $i >&2; tools/sgf2gtp.pl <$i; done; fi) | ./pachi -d 0 -e patternscan competition,spat_split_sizes | perl -nle ' BEGIN { use List::MoreUtils qw(uniq); } -- 2.11.4.GIT