![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,459
Karma: 22666665
Join Date: Dec 2010
Device: Kindle PW2
|
[Editor Plugin] LanguageTool
This plugin allows you to run a grammar check on the currently open HTML file with LanguageTool.
Credits: Kovid Goyal who helped me with the Calibre API. Disclaimer: Since I'm not a programmer you might want to save your books before having them checked by this plugin. (The plugin will also automatically create a checkpoint.) Installation: This plugin requires Java. To test whether Java is installed on your machine open a command prompt/terminal window and enter the following command: Code:
java -version You'll also need to download and unzip the desktop version of LanguageTool. (When you run the plugin for the first time, you'll be prompted to select languagetool-commandline.jar, which is located in the LanguageTool root folder.) Usage: Simply open an HTML file and click the LanguageTool icon. If LanguageTool finds any errors, the plugin will display them in a new window. For example, if you check: It don't matter to me. the plugin will display the following message. ... It don't matter to me.... GRAMMAR:HE_VERB_AGR The pronoun 'It' is usually used with a third-person or a past tense verb: 'doesn't', 'didn't' (GRAMMAR is a LanguageTool category and HE_VERB_AGR a LanguageTool rule.) Note that the plugin will use the value of the <dc:language> metadata entry for all files in the book. I.e., lang/xml:lang attributes will be ignored. Settings: The plugin doesn't come with a GUI, however, advanced users can change some of the default settings by editing LanguageTool.json, which will be created in the Calibre plugins folder (Preferences > Miscellaneous > Open Calibre configuration directory > plugins). Code:
{ "update_check": false, "close_cb": false, "allFiles": false, "clipboard_copy": false, "ltPath": "C:/Program Files/LanguageTool-5.0/languagetool-commandline.jar", "disabledRules": "MORFOLOGIK_RULE_EN_US,ENGLISH_WORD_REPEAT_BEGINNING_RULE, "disabledCategories": "REDUNDANCY" }
Troubleshooting: If you get a WindowsError: [Error 2] unhandled exception message, the Java binary couldn't be found. Installing/updating Java and re-booting your machine should take care of this problem. If you check a very large file, Windows might display (Not responding) in the title bar. This is normal. You'll have to wait until the check is completed. Version History Spoiler:
Last edited by Doitsu; 01-02-2022 at 07:43 AM. Reason: PyQt6 support added |
![]() |
![]() |
![]() |
#2 |
Interested in the matter
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 405
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
Wow!
Thank you very much Doitsu. I will try it today. Last edited by jbacelar; 12-09-2018 at 04:51 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Interested in the matter
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 405
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
Works very well.
Thanks again. |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 655
Karma: 408590
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Thanks, Doitsu!
Works perfectly, with support for pt-BR. |
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 700
Karma: 6483398
Join Date: Sep 2012
Device: Kobo Elipsa, Samsung Galaxy Note 8, Galaxy Tab S2 8.0
|
This tool saved me a ton of work on a very poorly edited book. Thank you.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 582
Karma: 197652
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
Hello people, I want to try the plugin and it gives me the following error. My language is Spanish, how should I configure the LanguageTool.json file?
In linux mint 19.2 |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,459
Karma: 22666665
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Did you download the latest Languagetool desktop version from the official website or via your Linux package manager? What's your Java version? What's your Languagetool version? If you have the latest versions installed, try changing the values of the disabledCategories and disabledRules JSON file entries to "". (I.e., delete them.) Last edited by Doitsu; 12-11-2019 at 01:14 PM. |
|
![]() |
![]() |
![]() |
#8 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 582
Karma: 197652
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
languagetool-commandline-2.2.jar ( 4.7) File Json { "allFiles": false, "clipboard_copy": false, "close_cb": false, "disabledCategories": "REDUNDANCY", "disabledRules": "MORFOLOGIK_RULE_EN_US,ENGLISH_WORD_REPEAT_BEGINNI NG_RULE", "ltPath": "/home/walter/languagetool-commandline.jar", "ngramIndexDir": false, "update_check": false } modified to: { "allFiles": false, "clipboard_copy": false, "close_cb": false, "disabledCategories": , "disabledRules": , "ltPath": "/home/walter/languagetool-commandline.jar", "ngramIndexDir": false, "update_check": false } I have reinstalled LanguageTool-4.7 and I wanted to inform you that the plugin works thanks for your work,Doitsu Last edited by dunhill; 12-12-2019 at 10:28 PM. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[LanguageTool]: Grammar check | Doitsu | Plugins | 91 | 01-31-2023 12:47 PM |
[Editor Plugin] EpubCheck | Doitsu | Plugins | 125 | 01-25-2023 03:03 PM |
Open Metadata Editor from plugin | notbuu | Development | 5 | 10-05-2016 01:10 AM |
Sample Plugin for the Editor | DiapDealer | Editor | 77 | 12-10-2014 08:16 AM |
Editor plugin question | DiapDealer | Development | 2 | 07-28-2014 11:23 PM |