On 28 May 2023, at 15:44, Sam Varshavchik <mrsam@courier-mta.com> wrote:

Hunspell does not have a functionally-equivalent C++ API. It has a C++ API of its own, but it's targeted at applications that come with their own language dictionaries. Its C++ API is, basically, a lookup function against a dictionary file that the application also supplies, it does not have a C++ API that offers a convenient way for applications to run a spell check against the system's default dictionary. The way for an application to do it is to have it run hunspell itself separately, and talk to it via pipes. Hopefully, it's easy for the application to do that without leaking other file descriptors.

I found the hunspell C++ API usable. See https://github.com/barry-scott/BarrysEmacs/blob/master/Editor/Source/Common/spell_checker.cpp for an example.

Barry