Patchwork

I developed an application for authors and am interested to include language tool as in LibreOffe e.g.

What can my next steps be?
Can I get some information from languagetool-commandline.jar?
Does exist an API?

Thanks,
Lupo

Hi Lupo,

thanks for your interest in LanguageTool. In case your application is written in Java, you could use our Java API (LanguageTool 6.0 API). Otherwise, I’d recommend using the HTTP interface, which is documented at HTTP Server - LanguageTool Wiki. We also provide a public server, see Public HTTP Proofreading API - LanguageTool Wiki.

You could also call the command-line version, but that has some start up cost and I wouldn’t recommend it.

Please let us know if you have more questions.

Regards
Daniel

Thanks, Daniel, for your immediate answer!

My application (Patchwork) is written in Delphi (Pascal). Online check is not optimal because some writers use offline computers to write or don’t have a web connection all the time.
Why is the command-line solution not recommendable? What do you mean with start up cost? And how do I get the result from the command-line version to integrate it into Patchwork?

Regards
Lupo

Hi Lupo. Users don’t need web access, they can run LT and visits its configuration dialog to enable a server. It will then run, by default, on localhost, port 8081.

Using the command line will require the whole Java and LT start for every check, this can take 2-3 seconds, additionally to the time the check itself takes. If you want to use that anyway, you can call LT like this: java -jar languagetool-commandline.jar --api -l en . It will print out XML with error information which you need to parse.

Hi Daniel, another possibility would be a transcription to Delphi as open source extension. Where can I have a look at the source code of the language tool engine? I assume the biggest part of the brain are the rules?

The source is available at GitHub - languagetool-org/languagetool: Style and Grammar Checker for 25+ Languages. It’s quite complex and needs several external libraries, which would also need to be ported, so I don’t think that this is a viable approach.