FAQ
Note in http://xapian.org/docs/spelling.html, about 1/3 of the way down
the page, the sentence, "Note that you must call the set_database()
method as well as setting FLAG_SPELLING so that Xapian knows where to
add the spelling dictionary entries."

Not real obvious, however. I'd like the API to also mention that fact.

Jim.
On 10/24/2010 09:00 PM, Jim Lynch wrote:
On 10/24/2010 07:42 PM, Marinos Yannikos wrote:
#!/usr/bin/perl

use Search::Xapian qw(:all);
use strict;

my $xa = new Search::Xapian::WritableDatabase ("/tmp/xapian",
DB_CREATE_OR_OVERWRITE);

my $indexer = Search::Xapian::TermGenerator->new();
$indexer->set_flags(Search::Xapian::FLAG_SPELLING);

my $doc = new Search::Xapian::Document;
$indexer->set_document($doc);
$indexer->index_text("hello 123 blah blah");

$xa->add_document($doc);
Try this:

#!/usr/bin/perl

use Search::Xapian qw(:all);
use strict;

my $xa = new Search::Xapian::WritableDatabase ("/tmp/xapian",
DB_CREATE_OR_OVERWRITE);

my $indexer = Search::Xapian::TermGenerator->new();
$indexer->set_database($xa);
$indexer->set_flags(Search::Xapian::FLAG_SPELLING);

my $doc = new Search::Xapian::Document;
$indexer->set_document($doc);
$indexer->index_text("hello 123 blah blah");

$xa->add_document($doc);

I think it needs to know what database to do the spelling check on.

Jim.


_______________________________________________
Xapian-discuss mailing list
Xapian-discuss at lists.xapian.org
http://lists.xapian.org/mailman/listinfo/xapian-discuss

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 6 | next ›
Discussion Overview
groupxapian-discuss @
categoriesxapian
postedOct 24, '10 at 11:42p
activeOct 25, '10 at 9:23p
posts6
users3
websitexapian.org
irc#xapian

People

Translate

site design / logo © 2021 Grokbase