[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[aspell-devel] Changing configuration

From: Alexandre Leduc
Subject: [aspell-devel] Changing configuration
Date: Tue, 04 Feb 2003 16:00:55 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030203

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);

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
spell_checker = w_new_aspell_speller(pConfRepl);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]