File: makepaircounts.sh

package info (click to toggle)
enca 1.13-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,440 kB
  • ctags: 1,230
  • sloc: sh: 11,125; ansic: 10,330; xml: 2,926; makefile: 698; perl: 232
file content (24 lines) | stat: -rwxr-xr-x 549 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="belarussian 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" = "belarussian"; 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