Fix build with xapian-core < 1.4.10
[xapian.git] / search-xapian / Xapian / TradWeight.pm
blobcd8acc880c21b85e4c3af5b9c74caf845aff7853
1 package Search::Xapian::TradWeight;
3 use 5.006;
4 use strict;
5 use warnings;
6 use Carp;
8 use Search::Xapian::Weight;
10 require DynaLoader;
12 our @ISA = qw( DynaLoader Search::Xapian::Weight);
14 # In a new thread, copy objects of this class to unblessed, undef values.
15 sub CLONE_SKIP { 1 }
17 sub new {
18 my $class = shift;
19 my $weight;
21 if (scalar(@_) == 0) {
22 $weight = new1();
23 } elsif (scalar(@_) == 1) {
24 $weight = new2(@_);
25 } else {
26 Carp::carp("USAGE: $class->new(), $class->new(k)");
27 exit;
29 bless $weight, $class;
30 return $weight;
35 __END__
37 =head1 NAME
39 Search::Xapian::TradWeight - Traditional Probabilistic Weighting scheme.
41 =head1 DESCRIPTION
43 Traditional Probabilistic Weighting scheme, as described by the early papers
44 on Probabilistic Retrieval. BM25 generally gives better results.
46 =head1 METHODS
48 =over 4
50 =item new
52 Constructor. Either takes no parameters, or a single non-negative parameter k.
53 If k isn't specified, the default value used is 1.
55 =back
57 =head1 SEE ALSO
59 L<Search::Xapian>,
60 L<Search::Xapian::Enquire>
62 =cut