I just realised this discussion went to the old sourceforge list
instead of this group; reposting my reply for the archives.
> But right now when a user wants to install a new dict they need to add
> it to the \share\enchant\myspell folder in the programs install dir.
> This is not a optimal solution for Windows Vista and Windows 7 as
> normal users are not supposed to write in the programs install folder
> (and Windows does some magic path redirection if user does it).
> The correct way would probably be to have the application tell enchant
> where to look for dicts (users settings folder).
> I looked briefly at the PyEncant doc and API and could not find a way
> to do this. Is it possible to do so?
The windows version of enchant checks various registry keys under
HKCU/Software/Enchant/ and HKLM/Software/Enchant/. I believe the you
set the myspell dictionary directory via the key:
HCKU/Software/Enchant/Myspell/Data_Dir
Older versions of enchant used to dynamically set this on application
startup to point to the files bundled with the enchant install. Not
ideal, but it does work.
The next release of PyEnchant (due out today, if things go well) includes
functions "set_param" and "get_param" that let you set these paths for
the current application. You could then do something like this:
enchant.set_param("enchant.myspell.dictionary.path",<USERS DATA DIR>)
Cheers,
Ryan
--
Ryan Kelly
http://www.rfk.id.au | This message is digitally signed. Please visit
ry...@rfk.id.au | http://www.rfk.id.au/ramblings/gpg/ for details
It still lists the default dicts shipped with pyenchant
(\share\enchant\myspell).
But I guess that is the expected behavior.
Thanks,
Fredrik
On Wed, Feb 24, 2010 at 2:35 PM, Fredrik Corneliusson
<fredrik.co...@gmail.com> wrote:
> Thanks!
> Very appreciated.
>
> Cheers
> Fredrik
Cheers
Fredrik
On Tue, Feb 23, 2010 at 1:43 AM, Ryan Kelly <ry...@rfk.id.au> wrote:
>
Cool, good to hear.
> It still lists the default dicts shipped with pyenchant
> (\share\enchant\myspell).
> But I guess that is the expected behavior.
>
Yes, I believe the default is to look for dicts in all the locations it
knows about - the default path, any paths in the registry, and any paths
set using set_param().