File: tovek4.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 (23 lines) | stat: -rw-r--r-- 549 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
#
# tvek felvtele a tulajdonnevek mellknvkpzs alakjaihoz
#
/.	./ {
    l1 = length($1);
    l2 = length($2);
    # ha a tulajdonnv s a mellknv megegyezik (els bett s a kpzt nem nzzk)
    if (substr($1, 2, l1-1) == substr($2, 2, l1-1)) {
	if (l1 != l2) {
	    print $2 "/g" l2-l1
	} else {
	    # a mretk megegyezik (pl. Hawaii/hawaii)
	    print $2 "/g"
	    print "__" $2 "/" $1
	}
    } else {
	# egybknt ha nem -y (vagyis i vagy j vg)
	if (match($1,"[^ij]$")) {
	    print $2 "/g"
	    print "__" $2 "/" $1	    
	}
    }
}