Yannick Warnier | 1 Sep 02:37
Gravatar

PHP error in index_text()

Hi there,

I'm using the Debian php5-xapian package version 1.0.7-3~bpo40+1 and
I'm getting this error:

Fatal error: No matching function for overloaded
'TermGenerator_index_text' in /usr/share/php/xapian.php on line 1498

The code around it (in xapian.php) is this:

        function index_text($text,$weight=1,$prefix=null) {
                switch (func_num_args()) {
                case 1: case 2: TermGenerator_index_text($this->_cPtr,
$text,$weight); break;
                default: TermGenerator_index_text($this->_cPtr,$text,
$weight,$prefix);
                }
        }

Line 1498 is the one with "case 1: case 2:".

The call to that function (index_text()) in my PHP script is actually
made (in this case) with 2 parameters from my PHP script:
- one empty string
- 1

I understand that it's wrong to send an empty string as first parameter
if that's supposed to be the text we want to index, but is it necessary
to trigger a fatal error ? (the message is not very explicit either...)

(Continue reading)

Rusty Conover | 1 Sep 11:57

Re: using xapian for indexing mails [SOLVED]

>
> I noticed that the stemming is language-specific (understandably); is
> there some recommended way to guess the language of a blob of text?  
> For
> me, speed is more important than 100% accuracy (which would be hard
> anyway, and consider multi-language text etc...)

n-gram analysis works pretty well..

In a nutshell it works like this:

Step 1. Training: With sample texts in various languages by produce n- 
grams, keep the most popular N n-grams for each language where N is  
sufficiently large.
Step 2. Analysis:  Compare the number of matching of n-grams from the  
unknown language text to the n-gram samples from each language.  The  
language with the most matches is probably the language of that text.

See:
http://www.rubyinside.com/whatlanguage-ruby-language-detection-library-1085.html
http://code.activestate.com/recipes/326576/

Regards,

Rusty
--
Rusty Conover
InfoGears Inc. / www.GearBuyer.com / www.FootwearBuyer.com
http://www.infogears.com
(Continue reading)

James Aylett | 1 Sep 12:55

Re: PHP error in index_text()

On Sun, Aug 31, 2008 at 07:37:24PM -0500, Yannick Warnier wrote:

> Fatal error: No matching function for overloaded
> 'TermGenerator_index_text' in /usr/share/php/xapian.php on line 1498
> 
>                 case 1: case 2: TermGenerator_index_text($this->_cPtr,
> $text,$weight); break;
> 
> The call to that function (index_text()) in my PHP script is actually
> made (in this case) with 2 parameters from my PHP script:
> - one empty string
> - 1

Is it definitely 1 and not "1"? That would trigger this, because the
bindings (I believe) are fairly type strict here. (In general they
have to be in order to get overloaded function calls to work sanely.)

Try also just dropping the $weight parameter, to ensure that $text is
really a string, and not something that tests == in PHP to "" such as
NULL, 0 etc..

J

--

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james <at> tartarus.org                               uncertaintydivision.org
David Spencer | 1 Sep 05:31
Picon

Makefile:379: .deps/xapian_wrap.Plo: No such file or directory

Briefly: when I try to build xapian-bindings the make command fails with:
"Makefile:379: .deps/xapian_wrap.Plo: No such file or directory"

When I run configure these are the last few lines:
I tried running "./configure" and "./configure --without-java --without-tcl
--without-tcl8 --without-csharp --without-perl --with-python
" with no difference. Note the tcl msg. I'm not sure if it's spurious or not
-- all I want are the python bindings.

config.status: creating java/Makefile
config.status: creating java/native/Makefile
config.status: creating java/org/Makefile
config.status: creating java/org/xapian/Makefile
config.status: creating java/org/xapian/errors/Makefile
config.status: creating java/org/xapian/examples/Makefile
config.status: creating java-swig/Makefile
config.status: error: cannot find input file: tcl8/Makefile.in

bash-3.2$ make

cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
Making all in python
Makefile:379: .deps/xapian_wrap.Plo: No such file or directory
make[2]: *** No rule to make target `.deps/xapian_wrap.Plo'.  Stop.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

(Continue reading)

James Aylett | 1 Sep 13:18

Re: Makefile:379: .deps/xapian_wrap.Plo: No such file or directory

On Sun, Aug 31, 2008 at 08:31:39PM -0700, David Spencer wrote:

> Briefly: when I try to build xapian-bindings the make command fails with:
> "Makefile:379: .deps/xapian_wrap.Plo: No such file or directory"
> 
> When I run configure these are the last few lines:
> I tried running "./configure" and "./configure --without-java --without-tcl
> --without-tcl8 --without-csharp --without-perl --with-python
> " with no difference. Note the tcl msg. I'm not sure if it's spurious or not
> -- all I want are the python bindings.
[...]
> config.status: error: cannot find input file: tcl8/Makefile.in

The way the system works, these files get used even if you aren't
building those bindings. I can't remember details, but I'm pretty sure
that you'll need to fix this before proceeding. tcl8/Makefile.in
should be in the archive you downloaded, or if you're using a SVN
snapshot it should be created by bootstrapping. Can you double-check
where you got the source from?

J

--

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james <at> tartarus.org                               uncertaintydivision.org
Favicon

Making SORTAFTER useful in omega?

Hello List,

Our users keep asking for some more "logical" sorting of search results. 
Now the results are sorted on relevance, i.e. the raw weight, by 
default. But since the users only see the percentage, that results in a 
seemingly random secondary sorting.

According to the docs and earlier mails, omega has the 'SORTAFTER' (and 
docid sorting) functionality to allow date-based secondary sorting. But 
according to later mails and the documentation that's only useful if you 
don't use the default BM25-weighting. Unfortunately you can't alter the 
weighting scheme via Omega-calls.
Nor does it seem to help to simply patch query.cc to use TradWeight 
rather than BM25.

Since we've built our set-up around omega, we'd rather not have to build 
something similar or patch omega just because its missing a small but 
important feature. Is it somehow possible to make the newer results in 
the seemingly similarly relevant results sort on top within Omega?

Best regards,

Arjen
Olly Betts | 2 Sep 00:39
Favicon
Gravatar

Re: Makefile:379: .deps/xapian_wrap.Plo: No such file or directory

On Sun, Aug 31, 2008 at 08:31:39PM -0700, David Spencer wrote:
> Briefly: when I try to build xapian-bindings the make command fails with:
> "Makefile:379: .deps/xapian_wrap.Plo: No such file or directory"
> 
> When I run configure these are the last few lines:
> I tried running "./configure" and "./configure --without-java --without-tcl
> --without-tcl8 --without-csharp --without-perl --with-python

If you just want Python, you only need "--with-python".

If you explicitly ask for particular bindings, you will only get those
you ask for.  If you don't specify, configure will probe what languages
support is available for and enable those.

Requiring users to explicitly disable every language they didn't want
would be clumsy - it's O(n) in the number of other languages supported,
and it would mean packaging scripts for xapian-bindings would need
fixing for every new language supported.

Many people seem to misunderstand how this works, but it seems the sanest
approach to me, and it is documented (in INSTALL).  If the documentation
could be clearer, please suggest how.

There isn't even a "--without-perl" or "--without-tcl8" option (and you
didn't pass "--without-ruby"...)

> config.status: error: cannot find input file: tcl8/Makefile.in

As James says, your source tree is incomplete for some reason.  You need
to work out why.
(Continue reading)

Olly Betts | 2 Sep 05:37
Favicon
Gravatar

Re: using xapian for indexing mails [SOLVED]

On Mon, Sep 01, 2008 at 03:57:29AM -0600, Rusty Conover wrote:
> > I noticed that the stemming is language-specific (understandably); is
> > there some recommended way to guess the language of a blob of text?  
> 
> n-gram analysis works pretty well..
[...]
> See:
> http://www.rubyinside.com/whatlanguage-ruby-language-detection-library-1085.html
> http://code.activestate.com/recipes/326576/

Also:

http://odur.let.rug.nl/~vannoord/TextCat/

Cheers,
    Olly
David Spencer | 3 Sep 07:57
Picon

Re: Makefile:379: .deps/xapian_wrap.Plo: No such file or directory

How embarrassing - everything magically works now - and I'm not sure what I
did differently last
night. I have verified on an Ubuntu Linux system and the 2 Macs I referred
to in my mail. On the Ubuntu
I started cleanly and everything worked first time.

On both Macs I removed the "untar dir" and started over i.e.

rm -rf xapian-core-1.0.7
tar zxf xapian-core*.gz
cd xapian-core-1.0.7
./configure
make
sudo make install

and with the bindings I did the same though with './configure --with-python'
and it all worked first time.

So sorry for the noise & confusion, things are cool now.

thx,
  Dave

On Mon, Sep 1, 2008 at 3:39 PM, Olly Betts <olly <at> survex.com> wrote:

> On Sun, Aug 31, 2008 at 08:31:39PM -0700, David Spencer wrote:
> > Briefly: when I try to build xapian-bindings the make command fails with:
> > "Makefile:379: .deps/xapian_wrap.Plo: No such file or directory"
> >
> > When I run configure these are the last few lines:
(Continue reading)

Charlie Hull | 3 Sep 11:22

Re: Xapian's 9th Birthday

Charlie Hull wrote:
> Hi all,
> 
> There will now be a Xapian birthday pubmeet on Wednesday 10th September 
> from 7pm at the 'Cambridge Blue' pub, Gwydir Street, Cambridge, U.K.
> 
> Myself, James Aylett and Richard Boulton will be there, and we'd love to 
> see any other Xapian enthusiasts.
> 
> More details at http://trac.xapian.org/wiki/MeetingsAndGatherings - add 
> your name if you can make it!
> 

Final reminder for this, which is now a week away: do add your name to 
the page above if you can make it. We'll raise a glass to Xapian 
enthusiasts everywhere.

Cheers

Charlie

Gmane