#!/bin/bash
set -e

debug="$2"
[ "$debug" ] && pattern="%w %p\n" || pattern="%p\n"

projtgm="${1%.*}projtgm"
# `echo "$1" | sed 's/all$/projtgm/'`
python3 scripts/igtall.py "$1" projtgm > "$projtgm"
tgrep2 -p "$projtgm" "$projtgm.tgc"
tgrep2 -m "$pattern" -c "$projtgm.tgc" scripts/wo.tgrep2 | scripts/wo.sed
