--- loncom/publisher/lonpublisher.pm 2000/11/30 10:11:47 1.4 +++ loncom/publisher/lonpublisher.pm 2000/11/30 11:22:58 1.5 @@ -16,6 +16,7 @@ use HTML::TokeParser; use Apache::lonxml; my %addid; +my %nokey; sub publish { @@ -144,9 +145,35 @@ sub publish { # -------------------------------------------------- Parse content for metadata my $allmeta=Apache::lonxml::xmlparse('meta',$content); - + +# DEBUG: + $scrout=$allmeta; +# --------------------------------------------------- Scan content for keywords + { + my $textonly=$content; + $textonly=~s/\//g; + $textonly=~s/\[^\<]+\<\/m\>//g; + $textonly=~s/\<[^\>]*\>//g; + $textonly=~tr/A-Z/a-z/; + $textonly=~s/[\$\&][a-z]\w*//g; + $textonly=~s/[^a-z\s]//g; + + my %keywords=(); + map { + unless ($nokey{$_}) { + $keywords{$_}=1; + } + } ($textonly=~m/(\w+)/g); + +# DEBUG: + + $scrout=join('
',sort keys %keywords); + + } + + } return $scrout; } @@ -213,6 +240,17 @@ sub handler { $addid{$1}=$2; } } + + %nokey=(); + + { + my $fh=Apache::File->new($r->dir_config('lonIncludes').'/un_keyword.tab'); + map { + my $word=$_; + chomp($word); + $nokey{$word}=1; + } <$fh>; + } # ----------------------------------------------------------- Start page output $r->content_type('text/html');