PHP enchant: where to place the myspell dictionaries (Mac OSX)

1k Views Asked by At
Array
(
    [0] => Array
        (
            [name] => aspell
            [desc] => Aspell Provider
            [file] => /usr/local/Cellar/enchant/1.6.0/lib/enchant/libenchant_aspell.so
        )

    [1] => Array
        (
            [name] => ispell
            [desc] => Ispell Provider
            [file] => /usr/local/Cellar/enchant/1.6.0/lib/enchant/libenchant_ispell.so
        )

    [2] => Array
        (
            [name] => myspell
            [desc] => Myspell Provider
            [file] => /usr/local/Cellar/enchant/1.6.0/lib/enchant/libenchant_myspell.so
        )

)

I'm using the enchant extension for spell checking and I need to add some myspell/hunspell dictionaries (*.dic, *.aff) to the engine. However, I can't find the right location to place them, thus I'm only getting access to the aspell dictionaries.

I've read that on Windows they should be placed in [PHP]/share/myspell/dict, but that doesn't work in my case (on MacOSX). I'm also a bit confused about the enchant_broker_get_dict_path and enchant_broker_set_dict_path functions. They don't appear in the current documentation still they are available (yet have no visible effect).

Any ideas?

Using PHP 5.3.28 (via brew).

1

There are 1 best solutions below

0
On

That's where it looks for the dictionaries:

/usr/share/myspell/dicts/

What I don't seem to be able control is which dictionary should it take in case of having multiple of them for the same language.