Re: [Pyenchant-users] Dictionary installation on Windows

101 views
Skip to first unread message

Ryan Kelly

unread,
Feb 22, 2010, 7:43:55 PM2/22/10
to pyencha...@googlegroups.com

Hi All,


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


signature.asc

Fredrik Corneliusson

unread,
Feb 24, 2010, 2:38:01 PM2/24/10
to pyencha...@googlegroups.com
Just tested it on Windows and it works well :-)

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

Fredrik Corneliusson

unread,
Feb 24, 2010, 8:35:26 AM2/24/10
to pyencha...@googlegroups.com
Thanks!
Very appreciated.

Cheers
Fredrik

On Tue, Feb 23, 2010 at 1:43 AM, Ryan Kelly <ry...@rfk.id.au> wrote:
>

Ryan Kelly

unread,
Feb 24, 2010, 6:33:40 PM2/24/10
to pyencha...@googlegroups.com
On Wed, 2010-02-24 at 20:38 +0100, Fredrik Corneliusson wrote:
> Just tested it on Windows and it works well :-)

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().

signature.asc
Reply all
Reply to author
Forward
0 new messages