#!/import/perl/bin/perl
# keywords2html.pl ../ascii/dt.toc > DigiTradKeywords.html

while (<>) {
    chop;
    ($songid, $songnum, $line, $start, $end, $tunecodes, $title, $cats) = split(/;/);
    $songid =~ tr/ //d;
    $Songs{$songid} = $title;
    $tunecodes =~ s/^%//;
    $tunecodes =~ tr/ //d;
    foreach $key (split(/@/,$cats)) {
	$lower = $key;
	$lower =~ tr/A-Z/a-z/;
	$cap{$lower} = $key;
	$keycounts{$lower}++ if $key;
    }
}


print <<EOF;
<TITLE>Digital Tradition Keywords</TITLE>
<H1>Keywords used in the Digital Tradition Database</H1>
Most songs in the database include one or more category keywords prefixed with an at "<B>@</B>" character, so you can use "<B>@</B>" to select from one or more categories (see <A HREF="DigiTradSearch.html">About Searching Digital Tradition</A>).
<P>
Select one of the following keywords
or go to the
<A HREF="AboutDigiTrad.html">Digital Tradition</A>
Database to
<A HREF="/digitrad/titles">Search Titles</A>
or <A HREF="/digitrad">Search Full Text</A>.
<MENU>
EOF
foreach $lower (sort keys %keycounts) {
    $key = $cap{$lower};
    print "<LI><A HREF=\"/digitrad/titles?@$key\">$key</A> ($keycounts{$lower})\n";
}
print "</MENU>\n";
