Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-08-2018, 02:41 PM   #1
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
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
If you don't get a version number, Java is either not installed or the Java binary can't be found. If Java is not installed, go to the Oracle website and download the latest Java version. (Note that you might need to re-boot your machine after the installation.)

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" 
}
  • update_check: If enabled, the plugin will check the LanguageTool GitHub website for LanguageTool updates.
  • close_cb: If enabled, the plugin will automatically close the Check Book window.
  • allFiles: If enabled, the plugin will check all HTML files.
  • clipboard_copy: If enabled, the plugin will copy all error messages as a tab-delimited file to the system clipboard.

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:

Version 0.1.3 - 20 April 2024
LanguageTool 6.x support added.
Version 0.1.2 - 2 Jan 2022
PyQt6 support added.
Version 0.1.1 - 07 Jul 2020
Python 3 support added.
Version 0.1.0 - 08 Dec 2018
Initial release.
Attached Files
File Type: zip LanguageTool.zip (9.6 KB, 9849 views)

Last edited by Doitsu; 04-20-2024 at 05:01 AM. Reason: LanguageTool 6.x support added
Doitsu is offline   Reply With Quote
Old 12-09-2018, 04:48 AM   #2
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
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.
jbacelar is offline   Reply With Quote
Advert
Old 12-09-2018, 06:52 AM   #3
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Works very well.
Thanks again.
jbacelar is offline   Reply With Quote
Old 12-09-2018, 09:12 AM   #4
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,069
Karma: 1221485
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Thanks, Doitsu!
Works perfectly, with support for pt-BR.
thiago.eec is offline   Reply With Quote
Old 11-28-2019, 01:29 PM   #5
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 794
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
This tool saved me a ton of work on a very poorly edited book. Thank you.
icallaci is offline   Reply With Quote
Advert
Old 12-10-2019, 10:11 PM   #6
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 773
Karma: 340954
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
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	628
Size:	45.1 KB
ID:	175515  
dunhill is offline   Reply With Quote
Old 12-11-2019, 01:05 PM   #7
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by dunhill View Post
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
Unfortunately, I don't have access to my computer right now. Based on the status message, either your Java version or your Languagetool version is incompatible.
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.
Doitsu is offline   Reply With Quote
Old 12-12-2019, 09:56 PM   #8
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 773
Karma: 340954
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by Doitsu View Post
Unfortunately, I don't have access to my computer right now. Based on the status message, either your Java version or your Languagetool version is incompatible.
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.)
What's your Java version? Java version attached
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
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	583
Size:	90.9 KB
ID:	175560  

Last edited by dunhill; 12-12-2019 at 10:28 PM.
dunhill is offline   Reply With Quote
Old 04-18-2024, 08:51 AM   #9
Capricorn
Belgian Pommes Frites
Capricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enough
 
Posts: 116
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
Computer: windows 11 with the latest updates
Calibre 7.8
Sigil editor 2.1.0
Language Tool Plugin: latest version
Language Tool version 5 and version 6

When I use the language Tool Plugin with version 5 of the language tool, it works without problem in the Calibre Editor and in Sigil Editor. However, when I use the plugin with the language Tool version 6, it does not work in Calibre Editor, but it does work in sigil editor.
In the Calibre editor, I get the following error message: see attachment

Is there a way to solve this?
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-04-18 134546.png
Views:	237
Size:	78.7 KB
ID:	207693  
Capricorn is offline   Reply With Quote
Old 04-18-2024, 11:31 AM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,441
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Capricorn View Post
Computer: windows 11 with the latest updates
Calibre 7.8
Sigil editor 2.1.0
Language Tool Plugin: latest version
Language Tool version 5 and version 6

When I use the language Tool Plugin with version 5 of the language tool, it works without problem in the Calibre Editor and in Sigil Editor. However, when I use the plugin with the language Tool version 6, it does not work in Calibre Editor, but it does work in sigil editor.
In the Calibre editor, I get the following error message: see attachment

Is there a way to solve this?
@Cap, It would be easier on us if you simply copied (to clipboard) and pasted the error log into a Spoiler tag pair (eye X'd out on the advanced edit bar)
theducks is online now   Reply With Quote
Old 04-18-2024, 02:05 PM   #11
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Most likely, in the latest version of LT some of the command line parameters changed. I'll have a look at this and'll release updated versions of the plugins.
Doitsu is offline   Reply With Quote
Old 04-19-2024, 02:11 AM   #12
Capricorn
Belgian Pommes Frites
Capricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enough
 
Posts: 116
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
Quote:
Originally Posted by theducks View Post
@Cap, It would be easier on us if you simply copied (to clipboard) and pasted the error log into a Spoiler tag pair (eye X'd out on the advanced edit bar)
I tried to copy/paste the error message. However, the plugin gives an error message on my screen that cannot be copied/pasted. Hence I took a snapshot and attached the file to my post, as I was not sure how else to get the info posed here. And clicking on the atteched file makes it very readable. I tested that.
My apologies if posting it that way is cumbersome.
Capricorn is offline   Reply With Quote
Old 04-19-2024, 02:12 AM   #13
Capricorn
Belgian Pommes Frites
Capricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enough
 
Posts: 116
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
Quote:
Originally Posted by Doitsu View Post
Most likely, in the latest version of LT some of the command line parameters changed. I'll have a look at this and'll release updated versions of the plugins.
Thank you very much. Looking forward to the updated plugin.
Capricorn is offline   Reply With Quote
Old 04-19-2024, 03:57 AM   #14
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,441
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Capricorn View Post
I tried to copy/paste the error message. However, the plugin gives an error message on my screen that cannot be copied/pasted. Hence I took a snapshot and attached the file to my post, as I was not sure how else to get the info posed here. And clicking on the atteched file makes it very readable. I tested that.
My apologies if posting it that way is cumbersome.
It has co copy to clipboard button, which seems to be a calibre standard?
theducks is online now   Reply With Quote
Old 04-19-2024, 02:28 PM   #15
Capricorn
Belgian Pommes Frites
Capricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enough
 
Posts: 116
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
Quote:
Originally Posted by theducks View Post
It has no copy to clipboard button, which seems to be a calibre standard?
No. Unfortunately not. No button, no nothing. Just what you see in the snapshot I attached. Just the error message.
But as the snapshot worked well (for me, at least)........................
Capricorn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] EpubCheck Doitsu Plugins 163 07-23-2024 09:07 AM
[LanguageTool]: Grammar check Doitsu Plugins 91 01-31-2023 12:47 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


All times are GMT -4. The time now is 10:56 PM.


MobileRead.com is a privately owned, operated and funded community.