File: makepaircounts.sh

package info (click to toggle)
enca 1.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,948 kB
  • sloc: ansic: 10,297; sh: 5,858; xml: 2,132; makefile: 700; perl: 261
file content (24 lines) | stat: -rwxr-xr-x 547 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/bash
textdir=/none/tmp/texts
maps=maps
letters=letters
subdirs="belarusian bulgarian russian ukrainian"

dir="$1"
test -n "$dir" || dir="$subdirs"

for d in $dir; do
  c=`ls $d/rawcounts.* | head -n1 | cut -d. -f2`
  echo '[ '$d / $c' ]'
  cat $textdir/$d/* | ./countpair $letters/$c.letters \
    >$d/paircounts.$c
  if test "$d" = "belarusian"; then
    c2=ibm866
    echo '[ '$d / $c2' ]'
    cat $textdir/$d/* | ./xlt $maps/$c.map $maps/$c2-bad.map \
      | ./countpair $letters/$c2-bad.letters \
      >$d/paircounts.$c2
  fi
done