Add support+docs for easy dataset generation
[gostyle.git] / data_summarize.sh
blob2d1b9b46cac8b16073eac34569aacc76522cc03e
1 #!/bin/sh
3 # data_summarize.sh - Summarize raw per-player pattern data by pattern frequency
5 # Usage: data_summarize.sh PLAYERLIST RAWPATDIR PATDIR
7 players=$1; shift
8 rawpatdir=$1; shift
9 patdir=$1; shift
11 summarize() {
12 sort | uniq -c | sort -rn
15 # per-player pattern data
16 cat "$players" | while read player; do
17 echo "$player"
18 cat "$rawpatdir/$player" | summarize >"$patdir/$player"
19 done
21 # summary pattern data
22 echo "all.pat"
23 cat "$players" | while read player; do cat "$rawpatdir/$player"; done |
24 summarize >"$patdir/all.pat"