File: melleknev_gen.awk

package info (click to toggle)
magyarispell 0.99.4-1.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,988 kB
  • ctags: 132
  • sloc: sh: 883; awk: 337; makefile: 240
file content (54 lines) | stat: -rw-r--r-- 1,954 bytes parent folder | download | duplicates (3)
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
#
# mellknevek ragozsi csoportba sorolsa
# 
BEGIN { 
    while ((getline var < "melleknev_a.1") > 0) { a_kotohangzo[var]=1; }
    while ((getline var < "melleknev_e.1") > 0) { e_kotohangzo[var]=1; }
    while ((getline var < "melleknev_mely.1") > 0) { mely[var]=1; }
    while ((getline var < "melleknev_ing.1") > 0) { ingadozo[var]=1; }
    while ((getline var < "melleknev_jaje.1") > 0) { jaje[var]=1; }
    while ((getline var < "melleknev_ae.1") > 0) { ae[var]=1; }
    while ((getline var < "melleknev_jajeae.1") > 0) { jajeae[var]=1; }
    while ((getline var < "melleknev_oe.1") > 0) { oe[var]=1; }
}

function a_koto(szo,kapcsolo) {
    if (a_kotohangzo[szo]==1) { 
        return "";
    } else if (e_kotohangzo[szo]==1) {
	return "/N";
    } else {
        return kapcsolo;
    }
}

function jaje_e(st,j,nemj) {
if (jaje[st]==1) {return j;} else {
if (ae[st]==1) {return nemj;} else {
if (jajeae[st]==1) {return j nemj; } else {
if (match(st,"[chjmsxyvz]$")!=0) { return nemj;}
  else {return j;}  
}}}}

/[aou]$/ { print $1 "/A/D/F/U/Q" a_koto($1,"/K") }
/[]$/ { print $1 "/C/D/H/W/R" a_koto($1,"/M") }
/[ei]$/ { if (mely[$1]==1) {print $1 "/A/D/F/U/Q" a_koto($1,"/K"); next } 
    else {print $1 "/B/D/G/V/R" a_koto($1,"/L"); next } }

/[aou][bcdfghjklmnpqrstvwxyz]+$/ || 
/^[bcdfghjklmnpqrstvwxyz]*[bcdfghjklmnpqrstvwxyz]*$/ ||
/^.*[uoa][bcdfghjklmnpqrstvwxyz]*i[bcdfghjklmnpqrstvwxyz]+$/ { 
    print $1 "/A/D/F/U" a_koto($1,"/K") jaje_e($1,"/Q","/S/s"); next }

/[ie][bcdfghjklmnpqrstvwxyz]+$/ { 
  if (mely[$1]==1) {print $1 "/A/D/F/U" a_koto($1,"/K") jaje_e($1,"/Q","/S/s")} 
  else { 
     if (ingadozo[$1]==1) { 
        print $1 "/A/D/F/U" a_koto($1,"/K") jaje_e($1,"/Q","/S/s") "/B/D/G/V" a_koto($1,"/L") jaje_e($1,"/R","/T/t") }
     else { print $1 "/B/D/G/V" a_koto($1,"/L") jaje_e($1,"/R","/T/t") }
  }
}

/[][bcdfghjklmnprstvxyz]+$/ { 
  print $1 "/B/D/G/V/N" a_koto($1,"/M") jaje_e($1,"/R","/T/t"); 
}