DICTION(1)

πŸ“¦
version 1.14 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

diction β€” print wordy and commonly misused phrases in sentences


✨ SYNOPSIS ✨

diction [-b] [-d] [-f file [-n|-L language]] [file...]
diction [--beginner] [--ignore-double-words] [--file file [--no-default-file|--language language]] [file...]
diction -h|--help
diction --version

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, here's the whole vibe: diction goes through a document and finds every single sentence that contains phrases from a database of frequently misused, bad or wordy diction. That's literally its whole thing. On top of that it also checks for double words (you know, the the, very very, that kind of situation πŸ’€).

If you don't give it any files, it reads the document from standard input. No file arguments, no problem, it'll just sip from stdin.

Every phrase it finds gets wrapped up in [ ] (brackets), like it's putting a little bow on it πŸŽ€. And if there are suggestions and advice available β€” and if you asked for them β€” they get printed headed by a right arrow ->.

Now, what counts as a sentence? A sentence is a sequence of words that starts with a capitalised word and ends with a full stop, double colon, question mark or exclaimation mark. That's the rule, periodt.

Some extra ✨sentence-boundary lore✨:

  • A single letter followed by a dot is considered an abbreviation</abbr>, so it does not terminate a sentence.
  • Various multi-letter abbreviations are recognized too, and they also do not terminate a sentence.
  • Neither do fractional numbers. Those little guys stay inside their sentence.

diction also understands cpp(1) #line lines, so it can give you precise locations when it prints sentences. slay.


🌸 OPTIONS 🌸

  • -b, --beginner β€” complain about mistakes typically made by beginners πŸ™ˆ
  • -d, --ignore-double-words β€” ignore double words and do not complain about them. the the, we're letting it slide
  • -s, --suggest β€” suggest better wording, if any πŸ’…
  • -f file, --file file β€” read the user specified database from the specified file, in addition to the default database
  • -n, --no-default-file β€” do not read the default database, so only the user-specified database is used
  • -L language, --language language β€” set the phrase file language (de, en, nl)
  • -h, --help β€” print a short usage message
  • --version β€” print the version

😭 ERRORS 😭

  • On usage errors, 1 is returned.
  • Termination caused by lack of memory is signalled by exit code 2.

🫢 EXAMPLE 🫢

The following example first removes all roff constructs and headers from a document and feeds the result to diction with a German database:

deroff -s file.mm | diction -L de | fmt

🌈 ENVIRONMENT 🌈

  • LC_MESSAGES=de|en|nl β€” specifies the message language and is also used as default for the phrase language. The default language is en.

πŸ‘‘ FILES πŸ‘‘

  • ${prefix}/share/diction/* β€” databases for various languages

🧚 the database file format (iykyk) 🧚

The file consists of lines, one per entry. Each line is divided by one or two tabs into two parts: left is the text to match and right is the suggestion.

The text to match either starts with a space to match a full word, or with letters to match suffixes. If it ends with a tilde, it matches a prefix.

The suggestion may be:

  • empty, to mark fill words
  • contain an explanation
  • start with an equal sign followed by text to match, for referring to the explanation of that text

The right part can consist of an exclamation mark to mark exceptions that should not be matched.

If both parts are separated by two tabs, then this entry concerns mistakes typically made by beginners.

Empty lines or lines starting with a hash are ignored. 🚫


πŸ’œ AUTHOR πŸ’œ

This program is GNU software, copyright 1997–2017 Michael Haardt <michael@moria.de>.

The English phrase file contains contributions by Wil Baden, Kimberly Hanks Gary D. Kline, Greg Lindahl <lindahl@pbm.com>, Beth Morris and Jeremy C. Reed. The Dutch phrase file was contributed by Hans Lodder.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


πŸŽ€ HISTORY πŸŽ€

There has been a diction command on old UNIX systems, which is now part of the AT&T DWB package. The original version was bound to roff by enforcing a call to deroff. This version is a reimplementation and must run in a pipe with deroff(1) if you want to process roff documents.

Similarly, you can run it in a pipe with dehtml(1) or detex(1) to process HTML or TeX documents. pipe it, pipe it πŸ¦‹


⭐ SEE ALSO ⭐

  • deroff(1), fmt(1), style(1)
  • Cherry, L.L.; Vesterman, W.: Writing Toolsβ€”The STYLE and DICTION programs, Computer Science Technical Report 91, Bell Laboratories, Murray Hill, N.J. (1981), republished as part of the 4.4BSD User's Supplementary Documents by O'Reilly.
  • Strunk, William: The elements of style, Ithaca, N.Y.: Priv. print., 1918, http://coba.shsu.edu/help/strunk/
  • There is a huge and actively maintained Standard American English database at: https://mrsatterly.com/diction.html

and that's the whole page bestie πŸ’… this one's GNU, dated September 2, 2017 β€” go forth and de-wordy your sentences, no cap 🫢✨

πŸ“¦ where this page comes from