Broker.DictWithPWL how to

47 views
Skip to first unread message

HWJ

unread,
May 11, 2012, 5:54:40 AM5/11/12
to pyenchant users
Hi,

unfortunately PyEnchant prefers ispell of aspell. But the Germany
dictionary of myspell is broken.
These two schemes do work

B= enchant.Broker()
B.set_ordering('de','aspell,myspell,ispell')
Lexikon= B.request_dict("de")

but now I cannot specify a separately managed personal list. At least
from my understanding of the documentation
the method B.request_pwl_dict() returns a dictionary made up of my
personal list only.

The standard method
Lexikon= enchant.DictWithPWL("de",pwl="German.plus")
works well, but uses the wrong sequence of dictionaries (i.e. myspell
in preference to aspell).

How can I combine both functionalities, i.e. DictWithPWL plus a
preference list of spell systems.

Many thanks for a hint,
Helmut.

Scott Grodberg

unread,
Jul 22, 2013, 8:00:37 AM7/22/13
to pyencha...@googlegroups.com
Bump

Ryan Kelly

unread,
Jul 24, 2013, 1:51:09 AM7/24/13
to pyencha...@googlegroups.com
On 22/07/2013 10:00 PM, Scott Grodberg wrote:
> Bump

Yikes, apologies for forgetting about this.
You can pass a "broker" argument to DictWithPWL. The following should
do that you want:

B = enchant.Broker()
B.set_ordering('de', 'aspell,myspell,ispell')
Lexikon - DictWithPWL("de", pwl="German.plus", broker=B)

I should probably expose "set_ordering" on the default broker as a
top-level function in the module, which would make this a lot easier.


Cheers,

Ryan


Reply all
Reply to author
Forward
0 new messages