File: oo2ispell.awk

package info (click to toggle)
bgoffice 4.1-7.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,192 kB
  • sloc: perl: 2,254; sh: 180; awk: 118; makefile: 83
file content (61 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/awk -f

BEGIN {
  print "#   Affix table for Bulgarian";
  print "";
  print "nroffchars	().\\\\*";
  print "texchars	()\\[]{}<\\>\\\\$*.%";
  print "";
  print "allaffixes	off";
  print "compoundwords	off";
  print "";
  print "flagmarker	/";
  print "";
  print "wordchars	[-] [-]";
  print "#      ~/.ispell_default,  ";
  print "#   ,      ";
  print "# (. ) ,      :";
  print "# wordchars	[a-z] [A-Z]";
  print "";
  print "#       -, -";
  print "#  -,       :";
  print "# boundarychars	\"-\"";
  print "";
  print "suffixes";
}

/SFX/ {
  if ($5 == "") {
    flag=$2;
    print "";
    if ($3 == "Y") {
      printf "flag *%s:\n", flag;
    } else {
      printf "flag ~%s:\n", flag;
    }      
  }
  if ($5 != "") {
    strip_str = "-" cyrtoupper($3) ",";
    if (strip_str == "-0,") {
      strip_str = "";
    }
    append_str = cyrtoupper($4);
    if (append_str == "0") {
      append_str = "-";
    }
    condition = $5;
    if (condition == "." && $3 != "0") {
      condition = cyrtoupper($3);
      gsub (/./, "& ", condition);
    }
    printf "    %-8s >      %s%s\n", condition, strip_str, append_str;
  }
}

function cyrtoupper(str,   new) {
  new = str;
  for (i = 224; i < 256; i++) {
    gsub (sprintf ("%c", i), sprintf ("%c", i - 32), new);
  }
  return new;
}