[Xapian-discuss] Getting spelling to work

James Aylett james-xapian at tartarus.org
Tue Jan 8 19:16:03 GMT 2008


On Tue, Jan 08, 2008 at 01:29:52PM -0500, Deron Meranda wrote:

> I can't seem to get the spelling correction/suggestion feature to work with
> the query parser.  Using the Python bindings with Xapian 1.0.5.

From
<http://xapian.org/docs/sourcedoc/html/classXapian_1_1QueryParser.html>:

FLAG_SPELLING_CORRECTION

    The query returned is based on the uncorrected query string
    however - if you want a parsed query based on the corrected query
    string, you must call QueryParser::parse_query() again.

which explains why your mset is empty on the query with
'datapase'. Your other problem, where qp.get_corrected_query_string()
is returning '' instead of 'database' I can't reproduce. I've attached
a small python script which will run without assertion failures on my
install (admittedly with Xapian HEAD not 1.0.5). If you still get an
assertion failure, there's a problem with 1.0.5 or possibly your
setup; if not, it's a problem with your code in some way.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_spelling.py
Type: text/x-python
Size: 974 bytes
Desc: not available
Url : http://lists.tartarus.org/pipermail/xapian-discuss/attachments/20080108/6a576730/test_spelling.py


More information about the Xapian-discuss mailing list