--- branches/CPAN/script/sman 2000/04/28 15:41:10 11 +++ trunk/script/sman 2004/05/24 13:44:01 88 @@ -1,27 +1,25 @@ -#!/usr/local/perl5.005_56.Mar06/bin/perl -w -######################### -*- Mode: Cperl -*- ######################### -## -## $Basename: sman $ -## $Revision: 1.8 $ -## -## Author : Ulrich Pfeifer -## Created On : Fri Aug 30 15:52:25 1996 -## -## Last Modified By : Ulrich Pfeifer -## Last Modified On : Sun May 30 17:48:53 1999 -## -## Copyright (c) 1996-1997, Ulrich Pfeifer -## -## -###################################################################### +#!perl -w +# -*- Mode: Perl -*- +# $Basename: sman $ +# $Revision: 1.14 $ +# Author : Ulrich Pfeifer +# Created On : Fri Aug 30 15:52:25 1996 +# Last Modified By: Ulrich Pfeifer +# Last Modified On: Mon May 8 11:03:46 2000 +# Language : CPerl +# +# (C) Copyright 1996-2000, Ulrich Pfeifer +# use strict; use Term::ReadLine; use Getopt::Long; -use Fcntl; +use Fcntl qw(O_RDONLY); use Config; +use '/data/wait/lib'; + require WAIT::Config; require WAIT::Database; require WAIT::Query::Base; @@ -43,7 +41,15 @@ 'table=s', 'filter=i', 'max=i', - 'pager:s') || die "Usage: ...\n"; + 'pager:s') || die " +Usage: $0 + [--database database] + [--dir dir ] + [--table table ] + [--filter integer ] + [--max integer ] + [--pager pager ] +"; my $db = WAIT::Database->open(name => $OPT{database}, mode => O_RDONLY, @@ -121,7 +127,7 @@ if ($@ ne '') { print $OUT "$_ => $query\n\$\@='$@'\n"; } elsif (ref($query)) { - %hits = $query->execute(); + %hits = $query->execute(top => $OPT{max}, picky => 1); # the hash %hits has as keys document numbers and as values # quality figures. The doc numbers are not what we have as docid # to find the item in the access class, they are WAIT's private @@ -157,9 +163,13 @@ } } continue { - # we don't do this since ANdreas Koenig does not think of it as feature + # we don't do this since Andreas Koenig does not think of it as feature # $term->SetHistory(grep length($_)>4, $term->GetHistory) } +warn "Thank you for using sman\n"; + +$tb->close; +$db->close; sub myreadline { if (@ARGV) { @@ -225,9 +235,9 @@ # WHAT DOES HE DO HERE? ULI??? # Re: some indexing scripts did use pathnames relative to the table directory # especially the cpanwait script does this. uli -# if ($tdid !~ m(^/)) { -# $tdid = $tb->dir . '/' . $tdid; -# } + if ($tdid !~ m(^/)) { + $tdid = $tb->dir . '/' . $tdid; + } # The main task of all that follows from here is highlighting. WAIT # is designed to make it possible to show the user why a certain