C API for managing LT HTTP servers?

Hello, we are looking at improving the LT plugin for LyX. We currently use the command-line interface, but due to Java’s startup time this is rather slow and not particularly well suited to as-you-go grammarchecking. The HTTP interface seems to be preferred by the LT developers but it is not clear if there is a preferred way of dealing with issues such as the following:

  1. We probably don’t want to accept requests over the network (I presume the LT server doesn’t do this by default)
    1b) … or ideally even from other users?
  2. We don’t want to send possibly private text to a LT server run by an untrusted user.
  3. We only need one server per user (perhaps less if a trusted user has a server running)
  4. We don’t want to keep a server running if all applications using it have been closed. (LanguageTool uses about 32MB of ram, I think)

Some of these issues could be deal with by the LyX team independently, but I wouldn’t want to reinvent the wheel. Further in principle LyX could share an LT server with abiword etc., but that wouldn’t happen if we use a different protocol.

It seems that these issues could be dealt with by a common C library that hides such issues from application developers, presenting them with a single function such as: char** languagetool(char* lang, char* text), perhaps with asynchronous extensions.

Given that plugins for C++ have already been written, has anyone made something like this? Is there an alternate preferred way to handling these issues?

1 Like

Hi John,

I cannot really answer your question, I just wanted to mention that the “security” of the LT server implementation indeed relies only on IP restrictions. By default, the server accepts only connections from localhost.

Maybe these questions are helpful for someone who wants to write a C++ access to LT:

These approaches do not rely on running LT as a server.

Regards
Daniel