File: fonev_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 (86 lines) | stat: -rw-r--r-- 2,612 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# fnevek ragozsi csoportba sorolsa
#
# kls vltoz: tulaj_e (tulajdonnevek esetn kikapcs. szsszettel)
# ha tulaj_e==1)
#
BEGIN { 
    while ((getline var < "fonev_mely.1") > 0) { mely[var]=1; }
    while ((getline var < "fonev_magas.1") > 0) { magas[var]=1; }
    while ((getline var < "fonev_ing.1") > 0) { ingadozo[var]=1; }
    while ((getline var < "fonev_jaje.1") > 0) { jaje[var]=1; }
    while ((getline var < "fonev_ae.1") > 0) { ae[var]=1; }
    while ((getline var < "fonev_jajeae.1") > 0) { jajeae[var]=1; }
    while ((getline var < "fonev_oe.1") > 0) { oe[var]=1; }
    while ((getline var < "fonev_kulon.1") > 0) { kulonszo[var]=1; }
    while ((getline var < "fonev_vege.1") > 0) { vegeszo[var]=1; }
    while ((getline var < "fonev_osszetett.1") > 0) { osszetett[var]=1; }
}
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,"[cghjmsxyvz]$")) { return nemj;}
  else {return j;}  
}}}}

function kulon(st) {
    if (tulaj_e==1) return "";
    if (vegeszo[st]==1) {
	return "/x/c"
    } else if (kulonszo[st]!=1) {
	return "/Y/c"
    } else {
	return "/c"
    }
}

function tulaj(st) {
    s="";
    if (osszetett[$1]==1) s="/y";
    if (tulaj_e==1) return s "/q";
    return s st;
}

/[aou]$/ { 
    print $1 "/A/U/K/Q" tulaj("/k/i") kulon($1)
}
/[]$/ { 
    print $1 "/C/W/M/R" tulaj("/m/j") kulon($1)
}
/[ei]$/ { 
    if (ingadozo[$1]==1) {
	print $1 "/A/U/B/V/K/L/Q/R" tulaj("/k/l/i/j") kulon($1)
    } else {
        if (mely[$1]==1) {
	    print $1 "/A/U/K/Q" tulaj("/k/i") kulon($1)
	} else {
	    print $1 "/B/V/L/R" tulaj("/l/j") kulon($1)
	}
    }
}
/[aouAOU][bcdfghjklmnpqrstvwxyz]+$/ { 
    if (magas[$1]==1) {
	    print $1 "/B/V/L" tulaj("/l/j") jaje_e($1,"/R","/T/t") kulon($1)
    } else {
	    print $1 "/A/U/K" tulaj("/k/i") jaje_e($1,"/Q","/S/s") kulon($1)
    }
}
/[ieIEY][bcdfghjklmnpqrstvwxyz]+$/ { 
    if (ingadozo[$1]==1) {
	print $1 "/A/U/B/V/K/L" tulaj("/k/l/i/j") jaje_e($1,"/Q/R","/T/t") kulon($1)
    } else {
	if (mely[$1]==1) {
	    print $1 "/A/U/K" tulaj("/k/i") jaje_e($1,"/Q","/S/s") kulon($1)
	} else { 
	    print $1 "/B/V/L" tulaj("/l/j") jaje_e($1,"/R","/T/t") kulon($1)
	}
    }
}
/[][bcdfghjklmnpqrstvxywz]+$/ { 
    if (oe[$1]==1) {
	print $1 "/B/V/L/N" tulaj("/l/j") jaje_e($1,"/R","/T/t") kulon($1)
    } else {
	print $1 "/C/W/M" tulaj("/m/j") jaje_e($1,"/R","/T/t") kulon($1)
    }
}