diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-03 14:57:35 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-03 14:57:35 +0800 |
commit | 0968ab809af2e54a46f7ea1be01073ee82ec96e7 (patch) | |
tree | 3c449d1f97aab4e4f73e5e813098ee2b5b9c35bd /staticweb | |
parent | b28691c2d7446e6194f180573c954dff0b55ed6c (diff) | |
download | pttbbs-0968ab809af2e54a46f7ea1be01073ee82ec96e7.tar pttbbs-0968ab809af2e54a46f7ea1be01073ee82ec96e7.tar.gz pttbbs-0968ab809af2e54a46f7ea1be01073ee82ec96e7.tar.bz2 pttbbs-0968ab809af2e54a46f7ea1be01073ee82ec96e7.tar.lz pttbbs-0968ab809af2e54a46f7ea1be01073ee82ec96e7.tar.xz pttbbs-0968ab809af2e54a46f7ea1be01073ee82ec96e7.tar.zst pttbbs-0968ab809af2e54a46f7ea1be01073ee82ec96e7.zip |
FuzzyIndex support
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1005 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'staticweb')
-rwxr-xr-x | staticweb/manbuilder.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/staticweb/manbuilder.pl b/staticweb/manbuilder.pl index 3ae5b22a..872506f2 100755 --- a/staticweb/manbuilder.pl +++ b/staticweb/manbuilder.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: manbuilder.pl,v 1.2 2003/07/03 06:50:54 in2 Exp $ +# $Id: manbuilder.pl,v 1.3 2003/07/03 06:57:35 in2 Exp $ use lib '/home/bbs/bin/'; use strict; use OurNet::FuzzyIndex; @@ -8,7 +8,7 @@ use DB_File; use BBSFileHeader; use Data::Serializer; -my(%db, %idx, $serial); +my(%db, $idx, $serial); sub main { @@ -21,6 +21,7 @@ sub main foreach( @ARGV ){ tie %db, 'DB_File', "$_.db", O_CREAT | O_RDWR, 0666, $DB_HASH; + $idx = OurNet::FuzzyIndex->new("$_.idx"); build("/home/bbs/man/boards/".substr($_, 0, 1)."/$_", ''); untie %db; } @@ -31,7 +32,7 @@ sub build($$) my($basedir, $doffset) = @_; my(%bfh, $fn, @tdir); - print "$basedir, $doffset\n"; + print "building $basedir\n"; tie %bfh, 'BBSFileHeader', $basedir; foreach( 0..($bfh{num} - 1) ){ next if( $bfh{"$_.filemode"} & 32 ); # skip HIDDEN @@ -44,6 +45,8 @@ sub build($$) else{ push @tdir, ["$doffset/$fn", $bfh{"$_.title"}]; my $c = $bfh{"$_.content"}; + $idx->insert("$doffset/$fn", $c); + $c =~ s/\</</gs; $c =~ s/\>/>/gs; $c =~ s/\"/"/gs; |