View Single Post
Old 05-04-2019, 12:24 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,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
[Plugin] Grammalecte

Initial release: October 17, 2020
Current Version: "0.1.4.2"

This plugin is a simple Grammalecte-based grammar/spell checker for French ebooks. (Unlike the LibreOffice version, this plugin does not come with a GUI.)

Credits: This plugin uses the Grammalecte 1.12.2 Python library.

System requirements: Sigil 0.9.5 or higher.

Installation:

1. Select Manage Plugins from the Plugins menu and select Use Bundled Python, if it isn't already selected or greyed out.

2. Click Add Plugin and select Grammalecte_v0.1.4.1.zip. This will install the Grammalecte plugin, which you can select via Plugins > Validation > Grammalecte.

Note that this plugin will only check files highlighted in the Book Browser window. (If you want to check all files, click the Text folder.)

Settings:

This plugin doesn't come with a GUI, however, advanced users can customize it by adding/editing the following Grammalecte.json entries:

Spoiler:
Code:
apos:	True	Apostrophe typographique
bs:	True	Populaire
chim:	False	Chimie [!]
conf:	True	Confusions et faux-amis
conj:	True	Conjugaisons
date:	True	Validité des dates
esp:	True	Espaces surnuméraires
gn:	True	Accords (genre et nombre)
html:	True	?
idrule:	False	Identifiant des règles de contrôle [!]
imp:	True	Impératif
infi:	True	Infinitif
inte:	True	Interrogatif
latex:	True	?
liga:	False	Signaler ligatures typographiques
maj:	True	Majuscules
mapos:	False	Apostrophe manquante après lettres isolées [!]
mc:	False	Mots composés [!]
nbsp:	False	Espaces insécables
neg:	False	Adverbe de négation [!]
nf:	True	Normes françaises
num:	True	Nombres
ocr:	False	Erreurs de numérisation (OCR) [!]
pleo:	True	Pléonasmes
ppas:	True	Participes passés, adjectifs
redon1:	False	Répétitions dans le paragraphe [!]
redon2:	False	Répétitions dans la phrase [!]
sgpl:	True	Pluriels (locutions)
tab:	False	Tabulations surnuméraires
tu:	True	Traits d'union
typo:	True	Signes typographiques
unit:	True	Espaces insécables avant unités de mesure
virg:	True	Virgules
vmode:	True	Modes verbaux


For example, if you add the following entries to Grammalecte.json:

Code:
liga:	True,
idrule:	True,
Grammalecte will flag common ligatures and display rule ids.

Note that since Sigil comes with a much better spell checker, typos reported by Grammalecte are hidden by default. To display them, simply change:

Code:
  "error_types": [
    "lGrammarErrors"
  ]
to:

Code:
  "error_types": ["lGrammarErrors", "lSpellingErrors"]
(As with all JSON entries, each entry, except for the last one, needs to be terminated by a comma.)

The plugin will also check the Grammalecte website at least once a week for updates. If you'd rather manually update the plugin, please change the following entry:

Code:
  "update_check": true,
to:

Code:
  "update_check": false,
Since the French dictionaries bundled with Sigil are slightly outdated, French users also might want to download and install the latest French Hunspell dictionaries from the Grammalecte website.

License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip Grammalecte_v0.1.4.2.zip (1.65 MB, 1452 views)

Last edited by Doitsu; 10-17-2020 at 02:19 PM. Reason: Fixed minor bug in Grammalecte update checker
Doitsu is offline   Reply With Quote