Is there a way to change a configuration key on the fly from an already created AspellSpeller?

The [scarce] documentation leads me to beleive that I have to somehow retrieve the confi from the speller, clone it, change it, delete the speller and re-initialize it with the new config.

AspellSpeller* spell_checker;
AspellConfig *spell_config;

// Create the spell checker
spell_config = new_aspell_config();
AspellCanHaveError *ret = new_aspell_speller(spell_config);
if(aspell_error_number(ret) == 0)
spell_checker = to_aspell_speller(ret);

// use it to do some spell checking

// I want to change the suggestion mode on the fly
// Does aspell_speller_config return a pointer to the internal to the speller's AspellConfig?
AspellConfig *pConf = aspell_speller_config(spell_checker);
AspellConfig *pConfRepl = aspell_config_clone(pConf);
delete_aspell_config(pConf);

aspell_config_replace(pConfRepl, key, value);

// Delete the speller and recreate it with the new config
// It crashes when I call delete_aspell_speller on the next line
delete_aspell_speller(spell_checker);
spell_checker = w_new_aspell_speller(pConfRepl);
delete_aspell_config(pConfRepl);



_______________________________________________
Aspell-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/aspell-devel

Reply via email to