version 1.66, 2001/12/17 01:50:54
|
version 1.67, 2001/12/25 21:58:54
|
Line 42
|
Line 42
|
# 12/05 Guy Albertelli |
# 12/05 Guy Albertelli |
# 12/06,12/07 Gerd Kortemeyer |
# 12/06,12/07 Gerd Kortemeyer |
# 12/15,12/16 Scott Harrison |
# 12/15,12/16 Scott Harrison |
|
# 12/25 Gerd Kortemeyer |
# |
# |
### |
### |
|
|
Line 541 sub publish {
|
Line 542 sub publish {
|
|
|
my $keywordout='<p><b>Keywords:</b><br><table border=2><tr>'; |
my $keywordout='<p><b>Keywords:</b><br><table border=2><tr>'; |
my $colcount=0; |
my $colcount=0; |
|
my %keywords=(); |
|
|
if (length($content)<500000) { |
if (length($content)<500000) { |
my $textonly=$content; |
my $textonly=$content; |
Line 551 sub publish {
|
Line 553 sub publish {
|
$textonly=~s/[\$\&][a-z]\w*//g; |
$textonly=~s/[\$\&][a-z]\w*//g; |
$textonly=~s/[^a-z\s]//g; |
$textonly=~s/[^a-z\s]//g; |
|
|
my %keywords=(); |
|
foreach ($textonly=~m/(\w+)/g) { |
foreach ($textonly=~m/(\w+)/g) { |
unless ($nokey{$_}) { |
unless ($nokey{$_}) { |
$keywords{$_}=1; |
$keywords{$_}=1; |
} |
} |
} |
} |
|
} |
|
|
|
|
foreach (split(/\W+/,$metadatafields{'keywords'})) { |
foreach (split(/\W+/,$metadatafields{'keywords'})) { |
$keywords{$_}=1; |
$keywords{$_}=1; |
} |
} |
|
|
foreach (sort keys %keywords) { |
foreach (sort keys %keywords) { |
$keywordout.='<td><input type=checkbox name="key.'.$_.'"'; |
$keywordout.='<td><input type=checkbox name="key.'.$_.'"'; |
if ($metadatafields{'keywords'}=~/$_/) { |
if ($metadatafields{'keywords'}) { |
$keywordout.=' checked'; |
if ($metadatafields{'keywords'}=~/$_/) { |
} |
$keywordout.=' checked'; |
|
} |
|
} elsif (&Apache::loncommon::keyword($_)) { |
|
$keywordout.=' checked'; |
|
} |
$keywordout.='>'.$_.'</td>'; |
$keywordout.='>'.$_.'</td>'; |
if ($colcount>10) { |
if ($colcount>10) { |
$keywordout.="</tr><tr>\n"; |
$keywordout.="</tr><tr>\n"; |
Line 574 sub publish {
|
Line 581 sub publish {
|
} |
} |
$colcount++; |
$colcount++; |
} |
} |
|
|
} else { |
|
$keywordout.='<td>File too long for keyword analysis</td>'; |
|
} |
|
|
|
$keywordout.='</tr></table>'; |
$keywordout.='</tr></table>'; |
|
|