--- /usr/pkg/share/namazu/filter/mhonarc.pl-oo Fri Jan 18 14:15:11 2002 +++ mhonarc.pl Tue Jan 29 16:34:52 2002 @@ -95,6 +95,7 @@ # Assume a normal message files by MHonArc v2.1.0 sub mhonarc_filter ($$) { my ($contref, $weighted_str) = @_; + my ($header) ; # It's useful to handle MHonArc message files. $$contref =~ s/.*//s; @@ -103,15 +104,28 @@ # Separate headers and a body message. $$contref =~ s//\n/; + $$contref =~ s/.*//s; + $$contref =~ s/(.*)//s; + $header = $1; + $$contref =~ s/.*]*>//s; + $header = XHeadertoheader($header); + if ( $header ) { + $$contref = $header . "\n" . $$contref ; + } + else { # Handle a field consists of two or more lines. $$contref =~ s!^(
  • )(.*?)(
  • $)!$1 . lftospace($2) . $3!gemsi; # For plugging spaces before headers $$contref =~ s/^
  • //gim; + } # Make header's name not to be indexed words. $$contref =~ s!!!gi; + util::dprint(_("contref after mhonarc:\n ").$$contref."\n"); + util::dprint(_("header after mhonarc:\n ").$header."\n"); + $$contref =~ s/^\s+//; } @@ -120,4 +134,22 @@ $str =~ s/[\r\n]/ /g; return $str; } +sub XHeadertoheader($) { + my ($str) = @_; + $str =~ s/\n\n//g; + $str .= "From: ".$from."\n"; + $str .= "Date: ".$date."\n"; + $str =~ s/-/-/g; # - -> (-) + return $str; +} +sub unrot13 ($) { + my $str = shift; + $str =~ tr/N-Z[@A-Mn-za-m/@A-Z[a-z/; +# $str =~ tr/@A-Z[a-z/N-Z[@A-Mn-za-m/; + $str; + } 1;