#! /bin/bash -eu
# Last edited on 2026-03-11 01:15:07 by stolfi

# Lists lines of the SPS that contains a given RE pattern {pat}, and sorts
# them by the position of that pattern in the line.

book="$1"; shift
kword="$1"; shift
ktag="$1"; shift

opa_file="res/${opa_name}-with-${ktag}.opa"
wc -l ${opa_file} 1>&2
 
echo "counting occurrences by position ..." 1>&2
sum_file="res/.starps-${ktag}-lines.tct"
cat ${opa_file} \
  | gawk \
      ' ' \
  1>&2
