smog/README.org

60 lines
2.8 KiB
Org Mode
Raw Normal View History

2020-02-05 22:07:38 +00:00
2020-02-16 21:57:23 +00:00
** Style & readability
[[https://melpa.org/#/smog][file:https://melpa.org/packages/smog-badge.svg]]
2020-02-05 22:07:38 +00:00
A simple way to analyse the writing style, word use and readability of prose in Emacs.
2020-02-05 22:07:38 +00:00
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
To install from source, download from http://ftp.gnu.org/gnu/diction/
2020-02-05 22:07:38 +00:00
** Configure
The emacs package can be installed from [[https://melpa.org/][MELPA]] or manually via [[https://github.com/zzkt/smog][github]].
2020-02-05 22:07:38 +00:00
#+BEGIN_SRC emacs-lisp
(use-package smog)
#+END_SRC
To configure language or output options, =setq= or customize the =smog-command= variable.
2020-02-05 22:07:38 +00:00
2020-02-08 21:31:39 +00:00
The 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.
2020-02-05 22:07:38 +00:00
#+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=
** Further
2020-02-05 22:07:38 +00:00
- [[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]]