r5045 - in /packages/libsearch-xapian-perl/trunk: ./ XS/ Xapian/
debian/ t/
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Fri Apr 13 18:35:25 UTC 2007
Author: gregoa-guest
Date: Fri Apr 13 18:35:25 2007
New Revision: 5045
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5045
Log:
* New upstream release.
* Add libtest-pod-coverage-perl to Build-Depends.
Added:
packages/libsearch-xapian-perl/trunk/XS/TradWeight.xs
- copied unchanged from r5044, packages/libsearch-xapian-perl/branches/upstream/current/XS/TradWeight.xs
packages/libsearch-xapian-perl/trunk/Xapian/TradWeight.pm
- copied unchanged from r5044, packages/libsearch-xapian-perl/branches/upstream/current/Xapian/TradWeight.pm
Modified:
packages/libsearch-xapian-perl/trunk/Changes
packages/libsearch-xapian-perl/trunk/MANIFEST
packages/libsearch-xapian-perl/trunk/META.yml
packages/libsearch-xapian-perl/trunk/Makefile.PL
packages/libsearch-xapian-perl/trunk/README
packages/libsearch-xapian-perl/trunk/XS/BoolWeight.xs
packages/libsearch-xapian-perl/trunk/XS/Enquire.xs
packages/libsearch-xapian-perl/trunk/Xapian.pm
packages/libsearch-xapian-perl/trunk/Xapian.xs
packages/libsearch-xapian-perl/trunk/Xapian/BoolWeight.pm
packages/libsearch-xapian-perl/trunk/Xapian/Enquire.pm
packages/libsearch-xapian-perl/trunk/Xapian/PositionIterator.pm
packages/libsearch-xapian-perl/trunk/debian/changelog
packages/libsearch-xapian-perl/trunk/debian/control
packages/libsearch-xapian-perl/trunk/t/search.t
packages/libsearch-xapian-perl/trunk/typemap
Modified: packages/libsearch-xapian-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/Changes?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/Changes (original)
+++ packages/libsearch-xapian-perl/trunk/Changes Fri Apr 13 18:35:25 2007
@@ -1,4 +1,25 @@
Revision history for Perl extension Search::Xapian.
+
+0.9.10.0 Tue Mar 06 02:27:02 2007
+ [Changes contributed by Rusty Conover]
+ - Wrap MatchDecider and make it usable with Enquire::get_mset()
+ - Wrap check_at_least parameter of Enquire::get_mset()
+ [Changes contributed by Olly Betts]
+ - Wrap rset parameter of Enquire::get_mset()
+ - Make all get_mset parameter combinations available via
+ Enquire::matches()
+ - Add tests for check_at_least and rset parameters of
+ Enquire::get_mset()
+ - Avoid warning from MakeMaker when generating Makefile for linking
+ against an uninstalled xapian-core tree.
+ - Correct several errors in the pod documentation for
+ Search::Xapian::PositionIterator.
+
+0.9.9.1 Mon Dec 11 06:08:57 2006
+ [Changes contributed by Olly Betts]
+ - Fix typo in BoolWeight documentation.
+ - Fix BoolWeight default constructor (broken by changes in 0.9.9.0).
+ - Wrap TradWeight class.
0.9.9.0 Mon Nov 09 02:31:09 2006
[Changes contributed by Olly Betts]
Modified: packages/libsearch-xapian-perl/trunk/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/MANIFEST?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/MANIFEST (original)
+++ packages/libsearch-xapian-perl/trunk/MANIFEST Fri Apr 13 18:35:25 2007
@@ -28,6 +28,7 @@
Xapian/SimpleStopper.pm
Xapian/Stopper.pm
Xapian/TermIterator.pm
+Xapian/TradWeight.pm
Xapian/ValueIterator.pm
Xapian/Weight.pm
Xapian/WritableDatabase.pm
@@ -51,6 +52,7 @@
XS/Stem.xs
XS/Stopper.xs
XS/TermIterator.xs
+XS/TradWeight.xs
XS/ValueIterator.xs
XS/Weight.xs
XS/WritableDatabase.xs
Modified: packages/libsearch-xapian-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/META.yml?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/META.yml (original)
+++ packages/libsearch-xapian-perl/trunk/META.yml Fri Apr 13 18:35:25 2007
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Search-Xapian
-version: 0.9.9.0
+version: 0.9.10.0
version_from: Xapian.pm
installdirs: site
requires:
Modified: packages/libsearch-xapian-perl/trunk/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/Makefile.PL?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/Makefile.PL (original)
+++ packages/libsearch-xapian-perl/trunk/Makefile.PL Fri Apr 13 18:35:25 2007
@@ -28,10 +28,12 @@
}
# We can't pass a .la file in LIBS since MakeMaker "knows better" and
- # ignores it. Passing it in LDLOADLIBS generates a warning, but works.
- print "Please ignore the warning that LDLOADLIBS is not a known parameter!\n";
- $libsvar = 'LDLOADLIBS';
+ # ignores it. Passing it in LDLOADLIBS works, but generates a warning.
+ # We can avoid the warning by setting LDLOADLIBS using 'macro'.
+ $libsvar = 'macro';
$libs = `$xapian_config --ltlibs`;
+ chomp($libs);
+ $libs = {'LDLOADLIBS' => $libs};
$LD = "$libtool --tag=CXX --mode=link $CC -avoid-version -module -no-install";
$CC = "$libtool --mode=compile $CC";
}
Modified: packages/libsearch-xapian-perl/trunk/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/README?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/README (original)
+++ packages/libsearch-xapian-perl/trunk/README Fri Apr 13 18:35:25 2007
@@ -1,5 +1,5 @@
-Search/Xapian version 0.9.9.0
-=============================
+Search/Xapian version 0.9.10.0
+==============================
This is Search::Xapian, a Perl XS frontend to the Xapian C++ search
library.
@@ -29,7 +29,7 @@
Please report any bugs/suggestions to <xapian-discuss at lists.xapian.org>
Copyright (c) 2002,2003 Alex Bowley. All rights reserved.
-Copyright (c) 2003,2004,2005,2006 Olly Betts. All rights reserved.
+Copyright (c) 2003,2004,2005,2006,2007 Olly Betts. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Modified: packages/libsearch-xapian-perl/trunk/XS/BoolWeight.xs
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/XS/BoolWeight.xs?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/XS/BoolWeight.xs (original)
+++ packages/libsearch-xapian-perl/trunk/XS/BoolWeight.xs Fri Apr 13 18:35:25 2007
@@ -3,7 +3,7 @@
PROTOTYPES: ENABLE
BoolWeight *
-new()
+BoolWeight::new()
CODE:
RETVAL = new BoolWeight();
OUTPUT:
Modified: packages/libsearch-xapian-perl/trunk/XS/Enquire.xs
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/XS/Enquire.xs?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/XS/Enquire.xs (original)
+++ packages/libsearch-xapian-perl/trunk/XS/Enquire.xs Fri Apr 13 18:35:25 2007
@@ -116,14 +116,35 @@
THIS->set_bias(bias_weight, bias_halflife);
MSet *
-Enquire::get_mset(first, maxitems)
+Enquire::get_mset1(first, maxitems, checkatleast = NO_INIT, rset = NO_INIT, func = NO_INIT)
doccount first
doccount maxitems
- CODE:
- RETVAL = new MSet();
- *RETVAL = THIS->get_mset(first, maxitems);
- OUTPUT:
- RETVAL
+ doccount checkatleast
+ RSet * rset
+ SV * func
+ CODE:
+ RETVAL = new MSet();
+ switch (items) { /* items includes the hidden this pointer */
+ case 3:
+ *RETVAL = THIS->get_mset(first, maxitems);
+ break;
+ case 4:
+ *RETVAL = THIS->get_mset(first, maxitems, checkatleast);
+ break;
+ case 5:
+ *RETVAL = THIS->get_mset(first, maxitems, checkatleast, rset);
+ break;
+ case 6: {
+ perlMatchDecider d = perlMatchDecider(func);
+ *RETVAL = THIS->get_mset(first, maxitems, checkatleast, rset,
+ &d);
+ break;
+ }
+ default:
+ croak("Bad parameter count for get_mset1");
+ }
+ OUTPUT:
+ RETVAL
ESet *
Enquire::get_eset(maxitems, rset)
Modified: packages/libsearch-xapian-perl/trunk/Xapian.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/Xapian.pm?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/Xapian.pm (original)
+++ packages/libsearch-xapian-perl/trunk/Xapian.pm Fri Apr 13 18:35:25 2007
@@ -22,6 +22,7 @@
use Search::Xapian::BM25Weight;
use Search::Xapian::BoolWeight;
+use Search::Xapian::TradWeight;
use Search::Xapian::SimpleStopper;
use Search::Xapian::PerlStopper;
@@ -86,7 +87,7 @@
our @EXPORT = qw( );
-our $VERSION = '0.9.9.0';
+our $VERSION = '0.9.10.0';
bootstrap Search::Xapian $VERSION;
@@ -315,13 +316,12 @@
The following Xapian classes are not yet wrapped:
Error (and subclasses), ErrorHandler, ExpandDecider (and subclasses),
-MatchDecider, TradWeight, user-defined weight classes.
+user-defined weight classes.
=item Unwrapped methods
The following methods are not yet wrapped:
Enquire::get_eset(...) with more than two arguments,
-Enquire::get_mset(...) with more than two arguments,
Enquire::register_match_decider(...) with one argument,
Query ctor optional "parameter" parameter,
Remote::open(...),
Modified: packages/libsearch-xapian-perl/trunk/Xapian.xs
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/Xapian.xs?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/Xapian.xs (original)
+++ packages/libsearch-xapian-perl/trunk/Xapian.xs Fri Apr 13 18:35:25 2007
@@ -42,7 +42,7 @@
SPAGAIN ;
if (count != 1)
- croak("Perl callback badness in PerlStopper::operator()\n");
+ croak("callback function should return 1 value, got %d", count);
// Breaks with SvTRUE(POPs) ?!?!?!
bool r = SvTRUE(SP[0]);
@@ -59,6 +59,54 @@
SV * SV_stopper_ref;
};
+class perlMatchDecider : public Xapian::MatchDecider {
+ private:
+ SV *callback;
+ public:
+ perlMatchDecider(SV *func) {
+ callback = newSVsv(func);
+ }
+
+ ~perlMatchDecider() {
+ SvREFCNT_dec(callback);
+ }
+
+ int operator()(const Xapian::Document &doc) const {
+ dSP;
+ Document *pdoc;
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(SP);
+
+ pdoc = new Document();
+ *pdoc = doc;
+
+ SV *arg;
+ arg = sv_newmortal();
+ sv_setref_pv(arg, "Search::Xapian::Document", (void *)pdoc);
+ XPUSHs(arg);
+
+ PUTBACK;
+
+ int count = call_sv(callback, G_SCALAR);
+
+ SPAGAIN;
+ if (count != 1)
+ croak("callback function should return 1 value, got %d", count);
+
+ SV *decide_result = POPs;
+ int decide_actual_result = SvIV(decide_result);
+
+ PUTBACK;
+
+ FREETMPS;
+ LEAVE;
+
+ return decide_actual_result;
+ }
+};
MODULE = Search::Xapian PACKAGE = Search::Xapian
@@ -81,6 +129,7 @@
INCLUDE: XS/Stem.xs
INCLUDE: XS/Stopper.xs
INCLUDE: XS/TermIterator.xs
+INCLUDE: XS/TradWeight.xs
INCLUDE: XS/PostingIterator.xs
INCLUDE: XS/PositionIterator.xs
INCLUDE: XS/ValueIterator.xs
Modified: packages/libsearch-xapian-perl/trunk/Xapian/BoolWeight.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/Xapian/BoolWeight.pm?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/Xapian/BoolWeight.pm (original)
+++ packages/libsearch-xapian-perl/trunk/Xapian/BoolWeight.pm Fri Apr 13 18:35:25 2007
@@ -19,7 +19,7 @@
=head1 DESCRIPTION
-Boolean Weighting scheme. Everything a weight of 0.
+Boolean Weighting scheme. All documents get a weight of 0.
=head1 METHODS
Modified: packages/libsearch-xapian-perl/trunk/Xapian/Enquire.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/Xapian/Enquire.pm?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/Xapian/Enquire.pm (original)
+++ packages/libsearch-xapian-perl/trunk/Xapian/Enquire.pm Fri Apr 13 18:35:25 2007
@@ -43,10 +43,29 @@
}
}
+sub get_mset {
+ my $self = shift;
+ my $nargs = scalar(@_);
+ if( $nargs == 3 ) {
+ my $type = ref( $_[2] );
+ if ( $type eq 'CODE' ) {
+ # get_mset(first, max, matchdecider) [perl extra]
+ splice @_, 2, 0, (0, 0);
+ } elsif ( $type eq 'Search::Xapian::RSet' ) {
+ # get_mset(first, max, rset)
+ splice @_, 2, 0, (0);
+ }
+ } elsif( $nargs == 4 && ref( $_[3] ) eq 'CODE' ) {
+ # get_mset(first, max, rset, matchdecider)
+ splice @_, 2, 0, (0);
+ }
+ return $self->get_mset1( @_ );
+}
+
sub matches {
- my ($self, $start, $size) = @_;
+ my $self = shift;
my @array;
- tie( @array, 'Search::Xapian::MSet::Tied', $self->get_mset($start, $size) );
+ tie( @array, 'Search::Xapian::MSet::Tied', $self->get_mset(@_) );
return @array;
}
@@ -105,10 +124,11 @@
=item get_query
-=item matches <start> <size>
-
-Takes the start element, and maximum number of elements, and
-returns an array tied to L<Search::Xapian::MSet::Tied>.
+=item matches <start> <size> [<check_at_least>]
+
+Takes the start element, and maximum number of elements (and optionally
+the minimum number of matches to check), and returns an array tied to
+L<Search::Xapian::MSet::Tied>.
=item get_matching_terms_begin
Modified: packages/libsearch-xapian-perl/trunk/Xapian/PositionIterator.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/Xapian/PositionIterator.pm?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/Xapian/PositionIterator.pm (original)
+++ packages/libsearch-xapian-perl/trunk/Xapian/PositionIterator.pm Fri Apr 13 18:35:25 2007
@@ -29,7 +29,8 @@
This iterator represents a stream of positions for a term. It overloads
++ for advancing the iterator, or you can explicitly call the inc method.
-This class also overloads 'eq', 'ne', '==', '!=', and "" (stringification).
+This class also overloads 'eq', 'ne', '==', '!=', "" (stringification),
+and +0 (conversion to an integer).
=head1 METHODS
@@ -45,14 +46,10 @@
Advance the iterator by one. (Called implictly by '++' overloading).
-=item skip_to <tname>
+=item skip_to <termpos>
-Skip the iterator to term tname, or the first term after tname if tname
-isn't in the list of terms being iterated.
-
-=item get_position
-
-Returns the current position.
+Skip the iterator to term position termpos, or the first term position after
+termpos if termpos isn't in the list of term positions being iterated.
=item equal <term>
@@ -64,14 +61,15 @@
Checks if a term is different from this term. Also overloaded to the 'ne'
and '!=' operators.
-=item get_termpos <term>
+=item get_termpos
-Return the term position the iterator is currently on. Also implemented
-as stringification.
+Return the term position the iterator is currently on. Also implemented as
+conversion to an integer.
=item get_description
-Returns a string describing this object. (for introspection)
+Returns a string describing this object (for introspection). Also implemented
+as stringification.
=cut
Modified: packages/libsearch-xapian-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/debian/changelog?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/debian/changelog (original)
+++ packages/libsearch-xapian-perl/trunk/debian/changelog Fri Apr 13 18:35:25 2007
@@ -1,3 +1,10 @@
+libsearch-xapian-perl (0.9.10.0-1) unstable; urgency=low
+
+ * New upstream release.
+ * Add libtest-pod-coverage-perl to Build-Depends.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at> Fri, 13 Apr 2007 20:34:57 +0200
+
libsearch-xapian-perl (0.9.9.0-1) unstable; urgency=low
* Initial release. (Closes: #402074)
Modified: packages/libsearch-xapian-perl/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/debian/control?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/debian/control (original)
+++ packages/libsearch-xapian-perl/trunk/debian/control Fri Apr 13 18:35:25 2007
@@ -1,9 +1,9 @@
Source: libsearch-xapian-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 5), perl (>= 5.8.0-7), libtest-pod-perl, libxapian-dev
+Build-Depends: debhelper (>= 5), perl (>= 5.8.0-7), libtest-pod-perl, libxapian-dev, libtest-pod-coverage-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Frank Lichtenheld <djpig at debian.org>, Olly Betts <olly at survex.com>
+Uploaders: Frank Lichtenheld <djpig at debian.org>, Olly Betts <olly at survex.com>, gregor herrmann <gregor+debian at comodo.priv.at>
Standards-Version: 3.7.2
XS-Vcs-Svn: svn://svn.debian.org/pkg-perl/packages/libsearch-xapian-perl/trunk/
Modified: packages/libsearch-xapian-perl/trunk/t/search.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/t/search.t?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/t/search.t (original)
+++ packages/libsearch-xapian-perl/trunk/t/search.t Fri Apr 13 18:35:25 2007
@@ -7,7 +7,7 @@
use Test::More;
use Devel::Peek;
-BEGIN { plan tests => 71 };
+BEGIN { plan tests => 79 };
use Search::Xapian qw(:ops);
#########################
@@ -59,6 +59,9 @@
my $matches;
ok( $matches = $enq->get_mset( 0, 10 ), "match set returned ok" );
is( $matches->get_matches_estimated(), 2, "match set contains correct number of results" );
+my $matches2;
+ok( $matches2 = $enq->get_mset( 0, 1, 3 ), "match set with check_at_least returned ok" );
+is( $matches2->get_matches_estimated(), 2, "match set contains correct number of results" );
my $match;
ok( $match = $matches->begin(), "match set iterator returned ok" );
@@ -83,6 +86,12 @@
$rset->remove_document( 1 );
ok( !$rset->contains( 1 ), "document removed from relevance set successfully" );
$rset->add_document( 1 );
+
+my $matches3;
+ok( $matches3 = $enq->get_mset(0, 10, $rset), "get_mset with rset" );
+is( $matches3->size, $matches->size, "rset doesn't change mset size" );
+ok( $matches3 = $enq->get_mset(0, 10, 11, $rset), "get_mset with check_at_least and rset" );
+is( $matches3->size, $matches->size, "rset and check_at_least don't change mset size" );
my $eset;
ok( $eset = $enq->get_eset( 10, $rset ), "can get expanded terms set" );
@@ -112,4 +121,10 @@
my $bm25;
ok( $bm25 = Search::Xapian::BM25Weight->new() );
+my $boolweight;
+ok( $boolweight = Search::Xapian::BoolWeight->new() );
+
+my $tradweight;
+ok( $tradweight = Search::Xapian::TradWeight->new() );
+
1;
Modified: packages/libsearch-xapian-perl/trunk/typemap
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libsearch-xapian-perl/trunk/typemap?rev=5045&op=diff
==============================================================================
--- packages/libsearch-xapian-perl/trunk/typemap (original)
+++ packages/libsearch-xapian-perl/trunk/typemap Fri Apr 13 18:35:25 2007
@@ -34,6 +34,8 @@
BM25Weight * O_WEIGHT
BoolWeight O_WEIGHT
BoolWeight * O_WEIGHT
+TradWeight O_WEIGHT
+TradWeight * O_WEIGHT
TermIterator O_TERM_I
TermIterator * O_TERM_I
More information about the Pkg-perl-cvs-commits
mailing list