smog/README.org

57 lines
2.7 KiB
Org Mode
Raw Normal View History

2020-02-05 22:07:38 +00:00
* Style & readability
A simple way to analyse the writing style, word use and readability of prose in Emacs.
It can be used by calling =smog-check-buffer= or =smog-check-region= on the selected region.
2020-02-05 22:07:38 +00:00
The analysis is produced via the command line tool =style=. It performs several [[https://en.wikipedia.org/wiki/Readability][readability]] tests on the text including; [[https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests][Flesch-Kincaid readability tests]], [[https://en.wikipedia.org/wiki/Automated_readability_index][Automated Readability Index]] (aka “ARI”), [[https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index][Coleman-Liau Index]], [[https://en.wikipedia.org/wiki/Gunning_fog_index][Gunning fog index]] (aka "Fog Index"), and [[https://en.wikipedia.org/wiki/SMOG][SMOG Index]] (aka "SMOG-Grading", “Simple Measure Of Gobbledygook“). It also summarises word usage and provides information about sentence and paragraph structure. The output is presented as a summary, so if you are looking for more specific, or continuous feedback on style and/or grammar then using =flycheck= with [[http://proselint.com/][proselint]] might be more suitable.
** Install
The textual analysis requires [[http://wiki.christophchamp.com/index.php?title=Style_and_Diction][style]] to be installed. The tools =style= and =diction= are part of the GNU project and should be available for most unix-like systems.
To install on Debian
#+BEGIN_SRC bash
apt install diction
#+END_SRC
To install on macOS
#+BEGIN_SRC bash
brew install style
#+END_SRC
** Configure
The package can be installed from [[https://melpa.org/][MELPA]] or manually via [[https://github.com/zzkt/smog][github]].
#+BEGIN_SRC emacs-lisp
(use-package smog)
#+END_SRC
To configure language or output options, =setq= or customize the =readability-command= variable.
Tthe default language is set to =en= (English) and can be changed to =de= for German or =nl= for Dutch. Details for the various output options can be found via =style -h= or =man style= in your shell of choice.
#+BEGIN_SRC emacs-lisp
(use-package smog
:config (setq smog-command "style -L en"))
#+END_SRC
e.g. to analyse a text in German and show sentences longer than 23 words…
#+BEGIN_SRC emacs-lisp
(use-package smog
:config (setq smog-command "style -L de -l 23"))
#+END_SRC
** Analyse surface detail
=M-x smog-check-buffer= and/or =M-x smog-check-region=
2020-02-05 22:07:38 +00:00
** Further
- [[https://wiki.christophchamp.com/index.php?title=Style_and_Diction][style]] is written by Michael Haardt with contributions from Jason Petrone, Uschi Stegemeier and Hans Lodder
- [[https://files.eric.ed.gov/fulltext/ED506404.pdf][The Classic Readability Studies]]. William H.DuBay, Editor
- [[https://en.wikipedia.org/wiki/Asemic_writing][Asemic writing]]