words.pl revision 34bff097c14521b5e57ce37279a34256e1f78aa5
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# ##### old intention below
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# read file "words.input" from current directory and produce
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# "\wordline{<word>}\hline" lines. plus patterns written in lines
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# starting with "%" . THe pattern should contain a variable calles
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# "$word. It functions as input.
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# words.input contains words seperated
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# by space, newline or tabular creates or overwrites a file called
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# "generated-words.tex"
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# the fonts file can be created by this bash line:
80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91Peter Major# for f in `ls /usr/share/texmf/tex/latex/psnfss/*.sty` ; do f=`basename $f| sed 's/\.sty//'`;echo '\usepackage{'$f'} ::: '$f ; done > fonts.input
80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91Peter Major#$ENV{'TEXINPUTS'} =$ENV{'TEXINPUTS'}."::".dirname($0);
80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91Peter MajorCopyright : (c) Klaus L�ttich, Uni Bremen 2002-2004
80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91Peter MajorLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91Peter Major Created by a Perl-script (HetCATS/utils/words.pl)!
80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91Peter Majormy %used_words = &process_the_words; # the words, LaTeX makros,
80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91Peter Major # syllables (ligatures), letters widely
80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91Peter Major # used in (Het)CASL
sub generate_haskell_FM {
my @two_letter_words = ();
(@words))),
my @first_letters =
&escape_String($_).
@long_words)).
(sort @two_letter_words)),
sub escape_String {
sub fm_header {
sub key_fm_header {
sub calc_max_width {
my %max_widths = ();
my %word_max_width = ();
print STDERR
$width_word_index++;
return %max_widths;
sub max {
sub process_one_font {
my $computer_tex_filename =
my $human_tex_filename =
if ($DO_PDFLATEX) {
my $computer_pdf_filename =
sub pdflatex {
sub get_widths {
my %widths = ();
if ($DO_PDFTOTEXT) {
my @widths = ();
while (<WIDTH>) {
m/section: (\w+)\+\+\+/o && do {
@widths = ();
close WIDTH;
return \%widths;
sub gen_tex {
my $output_filename =
while (<TEMPL>) {
print OUT $_;
close TEMPL;
close OUT;
return $output_filename;
sub read_fonts {
my @read_fonts = ();
while (<FONTS>) {
my @fnt_descrp = split /\s+:::\s+/;
close FONTS;
return @read_fonts;
sub process_the_words {
my @sec_words = ();
my %all_words = ();
if ($line =~ m/^%/o) {
chomp $line;
$line =~ s///o;
@sec_words = ();
$line =~ s///o;
} elsif ($line =~ m/^&/o) {
$line =~ s///o;
} elsif ($line =~ m/^~(.*)$/o) {
close WORDS;
close GENWORDS;
return %all_words;
sub sep_tabular {