Henka
2008-Nov-06 14:20 UTC
[Xapian-discuss] Perl XS Search::Xapian missing WritableDatabase::add_spelling?
Greets, I may be mistaken, but it looks like the Perl CPAN module Search::Xapian is missing method WritableDatabase::add_spelling, even though you can set FLAG_SPELLING_CORRECTION in QueryParser::parse_query to perform spelling checks on search terms. Are there any plans in the pipeline to plug this hole? Thanks Henry
Henry
2008-Nov-06 15:15 UTC
[Xapian-discuss] Perl XS Search::Xapian missing WritableDatabase::add_spelling?
Quoting Henka <henka at cityweb.co.za>:> I may be mistaken, but it looks like the Perl CPAN module > Search::Xapian is missing method WritableDatabase::add_spelling, > even though you can set FLAG_SPELLING_CORRECTION in > QueryParser::parse_query to perform spelling checks on search terms. > > Are there any plans in the pipeline to plug this hole?Better add Database::get_spelling_suggestion and spellings_begin/end to that.
Olly Betts
2008-Nov-06 22:25 UTC
[Xapian-discuss] Perl XS Search::Xapian missing WritableDatabase::add_spelling?
On Thu, Nov 06, 2008 at 04:20:09PM +0200, Henka wrote:> I may be mistaken, but it looks like the Perl CPAN module > Search::Xapian is missing method WritableDatabase::add_spelling, even > though you can set FLAG_SPELLING_CORRECTION in > QueryParser::parse_query to perform spelling checks on search terms. > > Are there any plans in the pipeline to plug this hole?Currently Search::Xapian is hand-coded in XS, so adding wrappers for new API features requires that the XS wrapper is written. Sometimes fiddling is needed, but often you just need to write an XS prototype. Then a simple testcase is really needed so we know the new wrapper actually works, and that it won't get broken by further changes. I try to get new stuff wrapped promptly, but sometimes I'm busy and sometimes I just miss stuff. Search::Xapian tends to lag a little behind the other bindings, where wrapping is pretty much automatic thanks to SWIG. Test cases are still very desirable for these too, though not as essential for simple additions as the code is completely auto-generated so there's less scope for stupid typos stopping it working, and if it works in one language, it's very likely to work for them all. If there are methods that you particularly need, I'm very happy to receive patches (and for something like add_spelling(), it's not hard to do even if you don't know XS - you usually just need to modify XS/<classname>.xs and can find a similar method to copy from). Ideally the patch should add test coverage too. I'd like to move Search::Xapian to SWIG, but SWIG doesn't currently calling back from C++ to Perl (though someone is working on that). Cheers, Olly