NAME
XAO::DO::SpellChecker::Base - base class for spellcheckers
SYNOPSIS
my $server=XAO::Objects->new(
objname => 'SpellChecker::Aspell',
});
$server->server_run;
my $speller=XAO::Objects->new(
objname => 'SpellChecker::Aspell',
);
$speller->switch_index($index_id);
my $pairs=$speller->suggest_replacements("speling bee");
my $speller=XAO::Objects->new(
objname => 'SpellChecker::Aspell',
);
my $wlist=$speller->dictionary_create;
$speller->dictionary_add($wlist,'perl');
$speller->dictionary_close($wlist);
DESCRIPTION
Provides spell-checker base functions -- server, client, utility functions. The actual spellchecker should be implemented independently on top of it.
Methods are:
- server_run ()
-
Runs the spellchecker server that clients can connect to. Never returns.
- switch_index ($)
-
Switches the spellchecker to a different index. This has an effect of creating another copy of spellchecker where supported, possibly connected to a different dictionary.
By default it simply stores new index into $self->{'current_index'}. Returns old index value.
- client_connect ()
-
Internal method. Connects to the spelling server.
- local_suggest_replacements ()
-
Pure virtual method, needs to be overriden by a specific spellchecker.
EXPORTS
Nothing.
AUTHOR
Copyright (c) 2005 Andrew Maltsev
<am@ejelta.com> -- http://ejelta.com/xao/
SEE ALSO
Recommended reading: XAO::Indexer, XAO::DO::Indexer::Base, XAO::DO::Data::Index.