#!/usr/local/bin/perl # This program has been created by Maxim Iorsh (iorsh@math.technion.ac.il). # It is a PUBLIC DOMAIN - you may do with it anything you wish. # The purpose of this program is to create a paragraph of meaningless # combinations of Hebrew letters with one very special property: each couple # of letters appears inside this paragraph at least once in each order. This # property would help you to kern Hebrew fonts: you simply typeset it in a # font of your choice, and than observe carefully the printed text in order # to reveal character pairs which are too close or too far from each other. # Enjoy! # Created at December 03, 2003; tested with Perl 5.004_03 on Solaris 9. use strict; my @lettergrid; my ($i, $last, $mixline); # Initialize array of pairs of letters: # 0xE0 is for aleph .. 0xFA is for tav foreach $i (0xE0 .. 0xFA) { push @lettergrid, ($i*256+0xE0 .. $i*256+0xFA) ; } $last = $#lettergrid; # Mix the array randomally for $i (0 .. $last) { my $r = int(rand($last - $i + 1)); my $tmp = $lettergrid[$last - $i]; $lettergrid[$last - $i] = $lettergrid[$r]; $lettergrid[$r] = $tmp; } # Convert each element to a pair of letters and append to a string $mixline = ""; for $i (0 .. $last) { $mixline = $mixline.chr($lettergrid[$i]).chr($lettergrid[$i]/256); } # From now on - pretty printing attempts # Put a space after each "sofit" letter $mixline =~ s/\xEA/\xEA /g; # final kaf $mixline =~ s/\xED/\xED /g; # final mem $mixline =~ s/\xEF/\xEF /g; # final nun $mixline =~ s/\xF3/\xF3 /g; # final pe $mixline =~ s/\xF5/\xF5 /g; # final tsadi # Remove standalone sofiyot letters $mixline =~ s/ [\xEA\xED\xEF\xF3\xF5]//g; # Split character sequences longer than 6 letters. Hopefully this will not # destroy any unique couple of letters # $mixline =~ s/(\S{6})/$1 /g; print $mixline."\n";