#! /usr/bin/perl
# $Id: dict2html,v 1.1 2000/06/27 15:27:12 villate Exp $
#
# dict2html - program to create an html version of the orca glossary.
# Copyright (C) Jaime Villate , 2000
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Jaime Villate, Faculdade de Engenharia, Rua dos Bragas, 4050-123 Porto
# Portugal
#
# The ORCA project
=head1 NAME
dict2html - Creates an HTML version of glosario.dict
=head1 SYNOPSIS
S
=head1 DESCRIPTION
This programs reads the glosario.dict text file and creates a HTML
version of it.
=head1 AUTHOR
Jaime Villate Evillate@fe.up.ptE.
=cut
use strict vars;
use vars qw($info $short $url $author $version $first $letter);
my $usage = "Usage: $0 \n";
my $keyw = '';
my $text = '';
my $word = '';
my $item = 0;
die $usage if ($#ARGV != 0);
my $filehandle = $ARGV[0];
die usage if ($filehandle =~ /^\-/);
die "$0: cannot find $filehandle.\n" if ! -f $filehandle;
(my $htmlname = $filehandle) =~ s/\.dict/\.html/;
open(DICT, "< $filehandle");
open(HTML,"> $htmlname");
while ()
{
if (/^([^0\#\s])/)
{
chop;
$word = $_;
$first = uc($1);
if ($item == 0)
{
preamble();
$item = 1;
$letter = $first;
print HTML qq{$letter };
print HTML qq{(ir al índice)};
print HTML qq{ \n
\n};
}
else
{
print HTML qq{
$keyw
$text.
\n};
if ($first ne $letter)
{
$letter = $first;
print HTML qq{