Henry
2008-Nov-26 10:08 UTC
[Xapian-devel] Trying to patch xapian perl add/remove_spelling
Greets, I'm giving a stab at patching the CPAN module to add the missing WritableDatabase::add_spelling and remove_spelling, but need a bit of guidance since I'm coming in cold, and pressed for time (aren't we all). I've modified XS/WritableDatabase.xs and added the two necessary functions, and also added the two basic tests in t/index.t. Compilation completes cleanly, but running perl index.t fails with Exception: This backend doesn't implement spelling correction at index.t line 48. I've obviously missed some file or something that needs to be set. The patch is attached. I'd appreciate some comments wrt what I'm missing. Thanks Henry -------------- next part -------------- A non-text attachment was scrubbed... Name: xapian-perl-spelling.patch Type: application/x-download Size: 1257 bytes Desc: not available URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20081126/11c36d30/attachment-0002.bin>
Olly Betts
2008-Nov-28 02:05 UTC
[Xapian-devel] Trying to patch xapian perl add/remove_spelling
On Wed, Nov 26, 2008 at 12:08:40PM +0200, Henry wrote:> Exception: This backend doesn't implement spelling correction at > index.t line 48. > > I've obviously missed some file or something that needs to be set. > The patch is attached. > > I'd appreciate some comments wrt what I'm missing.Much of the code in index.t is run for both inmemory and "auto" backends, but the inmemory backend doesn't implement spelling correction. Also, you can't use "ok(...)" around methods which don't return anything (if you do call "ok(...)" more, you need to increase the expected number of calls at the top of the file). I've tweaked the patch to compile and pass "make check". I haven't applied it yet as it doesn't seem to be useful without QueryParser::get_corrected_query_string() and/or Database::get_spelling_suggestion() also being wrapped... http://oligarchy.co.uk/xapian/patches/xapian-perl-spelling-updated.patch Cheers, Olly