/[wait]/branches/CPAN/lib/WAIT/Wais.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/CPAN/lib/WAIT/Wais.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by unknown, Fri Apr 28 15:41:10 2000 UTC revision 13 by ulpfr, Fri Apr 28 15:42:44 2000 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2  #                              -*- Mode: Perl -*-  #                              -*- Mode: Perl -*-
3  # $Basename: Wais.pm $  # $Basename: Wais.pm $
4  # $Revision: 1.3 $  # $Revision: 1.4 $
5  # Author          : Ulrich Pfeifer  # Author          : Ulrich Pfeifer
6  # Created On      : Mon Sep 16 11:08:04 1996  # Created On      : Mon Sep 16 11:08:04 1996
7  # Last Modified By: Ulrich Pfeifer  # Last Modified By: Ulrich Pfeifer
# Line 9  Line 9 
9  # Language        : CPerl  # Language        : CPerl
10  # Update Count    : 156  # Update Count    : 156
11  # Status          : Unknown, Use with caution!  # Status          : Unknown, Use with caution!
12  #  #
13  # (C) Copyright 1997, Ulrich Pfeifer, all rights reserved.  # (C) Copyright 1997, Ulrich Pfeifer, all rights reserved.
14  #  #
15  #  #
16    
17  package WAIT::Wais;  package WAIT::Wais;
18    
# Line 90  sub Retrieve { Line 90  sub Retrieve {
90    my %parm = @_;    my %parm = @_;
91    my $result = new WAIT::Wais::Result;    my $result = new WAIT::Wais::Result;
92    my $tb = _table($parm{database});    my $tb = _table($parm{database});
93      
94    unless (defined $tb) {    unless (defined $tb) {
95      $result->add(Tag => 'document', Error => 'Could not open database');      $result->add(Tag => 'document', Error => 'Could not open database');
96      return $result;      return $result;
# Line 190  sub new { Line 190  sub new {
190    my $type = shift;    my $type = shift;
191    my %par  = @_;    my %par  = @_;
192    my $self = {'header' => [], 'diagnostics' => [], 'text' => ''};    my $self = {'header' => [], 'diagnostics' => [], 'text' => ''};
193      
194    bless $self, $type;    bless $self, $type;
195  }  }
196    
# Line 213  sub _header { Line 213  sub _header {
213    } else {    } else {
214      $types = [keys %FORMATTER];      $types = [keys %FORMATTER];
215    }    }
216      
217    [$score, $lines, $length, $headline, $types,    [$score, $lines, $length, $headline, $types,
218     WAIT::Wais::Docid->new('wait',$database, $did)];     WAIT::Wais::Docid->new('wait',$database, $did)];
219  }  }
# Line 223  sub add { Line 223  sub add {
223    my %parm = @_;    my %parm = @_;
224    my $tag  = $parm{Tag};    my $tag  = $parm{Tag};
225    my $docid;    my $docid;
226      
227    if ($parm{Postings}) {    if ($parm{Postings}) {
228      my @result;      my @result;
229      my @left  = @{$self->{'header'}};      my @left  = @{$self->{'header'}};
# Line 266  sub add { Line 266  sub add {
266    
267  sub diagnostics {  sub diagnostics {
268    my $self = shift;    my $self = shift;
269      
270    @{$self->{'diagnostics'}};    @{$self->{'diagnostics'}};
271  }  }
272    
273  sub header {  sub header {
274    my $self = shift;    my $self = shift;
275      
276    @{$self->{'header'}};    @{$self->{'header'}};
277  }  }
278    
279  sub text {  sub text {
280    my $self = shift;    my $self = shift;
281      
282    $self->{'text'};    $self->{'text'};
283  }  }
284    

Legend:
Removed from v.12  
changed lines
  Added in v.13

  ViewVC Help
Powered by ViewVC 1.1.26