Elliniko Sorting

Alejandros Diamandidis adia at egnatia.ee.auth.gr
Sat Oct 24 13:06:49 EEST 1998


mikean at iesl.forth.gr (Mixalis Anogeianakis) wrote:
>>% Kai thelo na to taxinomiso me alfavitiki seira, omos
>>% thelo to gramma gamma [elliniko] na min paei sto sortarismeno arxeio
>>% sto G alla sto C, elpizo na katalavenete.

Dokimase to parakatw programmataki se Perl, fainetai na douleyei.
(dystyxws den jerw Perl, me apotelesma na einai poly argo, alla
apo to tipota...!)

#!/usr/bin/perl -w
sub trans {
        my $t = shift;
        $t =~ tr[áâãÁÂÃ]
                [abcABC];
        return $t;
}
@lines = <>;
print sort { trans($a) cmp trans($b) } @lines;

Ayto poy kanei einai na pernaei tis grammes toy arxeioy apo ena
`tr' poy metatrepei toys ellhnikoys xarakthres stoys antistoixoys
latinikoys, kai na sygkrinei to apotelesma. Gia na rythmiseis thn 
antistoixia, aplws allaje ta [áâãÁÂÃ] kai [abcABC].
An de thes na lambanei ypopsh kefalaia-mikra, allaje thn teleytaia
grammh vs ejhs:

print sort { lc(trans($a)) cmp lc(trans($b)) } @lines;

-- 
Alejandros Diamandidis * adia at egnatia.ee.auth.gr
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list