![]() |
[LanguageTool]: Grammar check
1 Attachment(s)
[LanguageTool]: Grammar check
Current Version: "0.4.3" This plugin is a very simple LanguageTool wrapper, which allows you to check the grammar of the currently loaded epub. It's a validation plugin that'll flag paragraphs with grammar errors. It does not come with a GUI like the LibreOffice version. For example, if you check the following sentence: I Can Has Cheezburger? you'll get the following validation panel message: Quote:
System requirements Since LanguageTool is a Java tool, you'll need to install Java. It also requires Sigil 0.9.x. (Linux users will also need to install the bs4 and lxml Python libaries.) You'll also need to download the latest LanguageTool desktop version and unzip it. Remember the location of the folder that contains languagetool-commandline.jar, because you'll later need to select that file. Optionally, if you want to use n-gram data sets for spellchecking, you'll need to download the huge n-gram data files (En, De, ES, FR, NL, HE, IT, RU, ZH) and define the path via ngramIndexDir. (Using this option will significantly slow down LanguageTool!) Installation 1. Select Manage Plugins from the Plugins menu. In the Manage Plugins dialog box, select Use Bundled Python, if it isn't already selected. 2. Click Add Plugin and select LanguageTool_v0.4.3zip. This will install the plugin, which you can select via Plugins > Validation > LanguageTool. By default, the plugin will only check the currently selected file, to check all files click the Text folder or change "allFiles": false to "allFiles": true in the LanguageTool.json preference file. Preferences You can change the following settings via plugin preference settings. (All of these settings need to be terminated with a comma unless it's the last line in the .json file.) A typical LanguageTool.json file looks like this: Code:
{clipboard_copy if enabled, messages will be copied to the clipboard; default: false allFiles if enabled, all files will be checked; default: false update_check if enabled, the plugin will check the LT website for updates; default: true ltPath path to languagetool-commandline.jar ngramIndexDir path to the n-gram directory b) LanguageTool preferences (for more information on these parameters see this website) enabledRules disabledRules enabledCategories disabledCategories enabledOnly In addition to these settings, the plugin will also look for a user-rules.xml file in the plugin folder. (You can test this feature by renaming en_user-rules.xml to user-rules.xml. If you rename this file to user-rules.xml, LanguageTool will flag all split infinitives in English epubs.) For example, if you check the following sentence: She used to secretly admire him. LT will display the following message: Quote:
If you want to use ngrams for grammar checking, you'll need to add the following entry at the beginning of LanguageTool.json: Code:
"ngramIndexDir": "C:/ngrams",C:/ngrams/en/1grams C:/ngrams/en/2grams C:/ngrams/en/3grams Obviously, the values in Magenta need to be changed to match the actual installation folders. Python also requires slashes (/) or double back-slashes (\\) for Windows folder names. Note that n-gram checking is very slow. However, it can detect some errors that rules can't detect. For example, if you check the following sentence: Don't go their. it'll report: Quote:
Depending on the book type, you might get lots of false positives. You can filter them out via the disabledRules and disabledCategories settings. Note that the plugin will use the language defined in the epub metadata section for all files in the epub, regardless of lang or xml:lang attributes. If you define an unsupported language code, LanguageTool will fail. Supported language codes are: Spoiler:
By default, LanguageTool will also do a spellcheck. However, since Sigil has a much more advanced spellchecker, this option should be disabled. For US English it's already disabled by default via the MORFOLOGIK_RULE_EN_US rule. For other languages different rules will need to be added to the disabledRules setting. Update Check setting By default, the plugin will connect to the LanguageTool Github web site to check for LanguageTool updates. If you don't want the plugin to connect to the Internet, change the following LanguageTool.json setting to false. Code:
"update_check": true |
This is very cool. The interface is a bit rough (the LanguageTool messages are truncated, as discussed in another thread), but it’s already usable. Thank you!
|
1 Attachment(s)
I've attached a new version to the first post that'll indicate the column number (= cursor position) of the word or phrase that LT has flagged.
This should make it easier to locate these words or phrases in long paragraphs. For an example, see the attached screenshot. |
New version 0.4 with cursor positioning support released
I attached an updated version for Sigil 0.9.7 with cursor positioning support to the first post.
I.e., if you click an error message it'll move the cursor to the word that was flagged. (Occasionally, the cursor position might be off by a couple characters.) This should make it easier to find the words flagged by LanguageTool. BTW, the LanguageTool developers have released a new standalone LanguageTool version: LanguageTool 0.3.6 |
1 Attachment(s)
Quote:
|
Quote:
BR |
Quote:
To fix this error either search in Synaptic or your distro's package manager for python3-tk and install it. If you can't find it enter the following command in a terminal window: Code:
sudo apt-get install python3-tk |
Quote:
|
1 Attachment(s)
Quote:
|
Quote:
|
Quote:
Mine came as a zip (LanguageTool-3.5.zip), which I unpacked into a LanguageTool-3.5 sub-directory in my _Utilities/Productivity directory. So when I got that request from the Sigil plugin, I navigated to _Utilities\Productivity\LanguageTool-3.5 and selected the file languagetool.jar, which is what it's asking for, see top right corner of your screen shot. BR |
Quote:
|
Quote:
|
1 Attachment(s)
It gave me a different window this time. I got as close as this (screenshot) and got stuck. And it was asking for a file and the Language Tool was a folder. Am I supposed to enter something into that box? 'Cause when I clicked on the Language Tool folder and 'open' it did nothing.
|
Quote:
BR |
| All times are GMT -4. The time now is 06:58 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.