Updated documentation, ERADME, scanning, sorting and filter virtual file handles...
[idzebra-moved-to-github.git] / perl / lib / IDZebra / ScanEntry.pm
1 # $Id: ScanEntry.pm,v 1.2 2003-03-05 13:55:22 pop Exp $
2
3 # Zebra perl API header
4 # =============================================================================
5 package IDZebra::ScanEntry;
6
7 use strict;
8 use warnings;
9
10 BEGIN {
11     use IDZebra;
12     use IDZebra::Logger qw(:flags :calls);
13     use Scalar::Util qw(weaken);
14     use Carp;
15     our $VERSION = do { my @r = (q$Revision: 1.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; 
16 }
17
18 1;
19
20 # -----------------------------------------------------------------------------
21 # Class constructors, destructor
22 # -----------------------------------------------------------------------------
23
24
25 sub new {
26     my ($proto,%args) = @_;
27     my $class = ref($proto) || $proto;
28     my $self = \%args;
29     bless ($self, $class);
30     weaken ($self->{list});
31     return ($self);
32 }
33
34 # =============================================================================
35 sub DESTROY {
36     my $self = shift;
37 }
38
39 # -----------------------------------------------------------------------------
40 sub term {
41     my $self = shift;
42     return ($self->{entry}{term});
43 }
44
45 sub occurrences {
46     my $self = shift;
47     return ($self->{entry}{occurrences});
48 }
49
50 sub position {
51     my $self = shift;
52     return ($self->{position});
53 }
54 # -----------------------------------------------------------------------------
55 __END__
56
57 =head1 NAME
58
59 IDZebra::ScanEntry - An entry of the scan results
60
61 =head1 SYNOPSIS
62
63   foreach my $se ($sl->entries()) {
64       print STDERR ($se->position ,": ",
65                     $se->term() . " (",
66                     $se->occurrences() . "\n");
67   }
68  
69 =head1 DESCRIPTION
70
71 A scan entry describes occurrence of a term in the scanned index.
72
73 =head1 PROPERTIES
74
75 =over 4
76
77 =item B<term>
78
79 The term itself.
80
81 =item B<position>
82
83 Position of term in the list. 1 based.
84
85 =item B<occurrences>
86
87 The occurrence count of the term in the selected database(s).
88
89 =back 
90
91 =head1 TODO
92
93 A I<resultSet> and maybe a I<records> method, to reach the records, where the term occurred.
94
95 =head1 COPYRIGHT
96
97 Fill in
98
99 =head1 AUTHOR
100
101 Peter Popovics, pop@technomat.hu
102
103 =head1 SEE ALSO
104
105 IDZebra, IDZebra::ScanList, Zebra documentation
106
107 =cut