[Announcement] More online materials from Prof. Tokunaga

Toru Tomabechi Toru.Tomabechi at ORIENT.UNIL.CH
Tue Feb 9 05:20:47 UTC 1999


Dear list members,

A short note on the metric data of the MBh Prof. Tokunaga kindly offers.

I wrote the program Prof. Tokunaga used quite years ago. It was
developped on a 286 machine without floating point processor, using
x86 assembly language (to obtain a maximum performance on that poor
machine). This imposed on me a restriction in the precision of
arithmetic calculation. (And I can no longer maintain the code as I
completely trashed the DOS environment in favor of Linux: so please
don't ask me about that old program). Now, however, the average
performance and resources available on personal computers are
infinitely higher than were in those old days, and it is thus possible
to run some high performance scripting languages, such as perl,
python, ruby, etc., with reasonable execution time and high
calculative precision (and with, above all, program portability among
different platforms). So I wrote a sample (and simple) perl script to
obtain a somewhat refined statistic from Prof. Tokunaga's data. I
believe it is quite easy, with minimum knowledge in perl, to modify
the script to make it fit to one's own need.  If you'd like, please
try it!

Toru Tomabechi, University of Lausanne

---------------------------------8<--------------------------
#!/usr/bin/perl

while(<>){
    chop; chop;
    if(/^[0-9]/){
        ($num, $pat, $met) = split(/\t/, $_);
        $metres{$met}++;
        $total++;
    }
}

foreach $key (sort keys %metres){
    printf ("%s: %05s/%05s ", $key, $metres{$key}, $total);
    printf ("(%06.3f%%)\n", ($metres{$key}/$total)*100);
}

print "---------------\n";

foreach $key (sort keys %metres){
    if($key =~ /^zloka\(([1234PDMm])/){
        $num_zloka+=$metres{$key};
        $zlokas{$1}+=$metres{$key};
    }
}

printf ("zloka total : %05d lines\n", $num_zloka);
foreach $key (sort keys %zlokas){
    printf ("zloka %5s : %05d/%05d (%06.3f%%)\n",
            $key, $zlokas{$key}, $num_zloka, ($zlokas{$key}/$num_zloka)*100);
}

-----------------------------------8<------------------------------





More information about the INDOLOGY mailing list