Shell scripts to improve your writing
matt.might.net
matt.might.net
; cat <<EOF >/tmp/testfile
Diction and style are two old standard Unix commands. Diction identifies wordy and commonly misused phrases. Style analyses surface characteristics of a document, including sentence length and other readability measures.
These programs cannot help you structure a document well, but they can help to avoid poor wording and compare the readability (not the understandability!) of your documents with others. Both commands support English and German documents.
EOF
; LANG=C diction --lang en --suggest /tmp/testfile
/tmp/testfile:2: These programs cannot help you structure a document well, but [they -> (do not use as substitute for "each, each one, everybody, every one, anybody, any one, somebody, some one")] [can -> (do not confuse with "may")] help to avoid poor wording and [compare -> "Compare" to points out resemblances, "compare with" points out differences.] the readability (not the understandability!) of your documents with others.
3 phrases in 5 sentences found.
http://www.chronicle.com/article/50-Years-of-Stupid-Grammar/...
He doesn't even correctly identify what weasel words are. ("Some people say", "It is believed", etc). I'm not sure why 'very close match' is any more opinionated than 'close match' is. It's not as if the latter is precisely defined.
The other reason is probably that "very" is very easy to detect in a bash script, whereas looking for other, more subtle weasels is a lot harder. Given the generally poor level of scientific writing (I have certainly given my PhD advisor some turds), huge improvements can be had by just going after the easiest cases.
Here, the two things that might be thrown away are of the same value (justifiable passive voice vs unjustifiable passive voice), and it's not that big a value to begin with.
Plus, you have a perfectly good replacement (active voice).
Lastly, it's just a general advice for people who overuse unjustified passive voice. It's not supposed to be subtle. If those people could understand subtlety they'd kept the justified passive voice themselves when it's appropriate.
A couple of ideas:
* There's an idea that passive voice is inappropriate because it "avoids responsibility" (for example, because it does not say who made a decision or performed an action, where that information might be important). An example could be when an organization says "your application was denied" (where it would somehow seem more honest or more relevant to say "we denied your application" or "the vice president denied your application"), or in a political context referring to violence without referring to the perpetrator of that violence -- "thirty people were killed" (by whom?).
However, critics have pointed out that these concerns don't correspond perfectly to the active/passive voice distinction, among other things because we can still state who was responsible when using the passive voice and because we can still avoid stating who was responsible when using the active voice. Also, sometimes clear or honest writing wouldn't need to assign responsibility at every moment, in every context, or in every sentence.
* There's an idea that the passive voice is inappropriate because it sounds too formal and hence makes writing less accessible, less enjoyable to read, or lends the writing an unwarranted air of authority. The active voice may sound more direct or straightforward in many contexts, while the passive voice may sound unduly formal, abstract, or academic.
This is probably also true, but doesn't appear to justify a blanket prohibition either.
* Edit: also compare https://en.wikipedia.org/wiki/E-Prime, a writing style that tries to avoid using the copula (certain uses of the verb "to be"), based on the view that it makes philosophically unjustified observer-independent claims that could be made more precise by showing whose perception or belief is being described (like "spinach is yucky" vs. "George H. W. Bush dislikes spinach" or "George H. W. Bush finds spinach yucky"). The copula isn't the same as the passive voice, but this is a (controversial) example of another way in which people have suggested constraining their writing in support of "taking responsibility" for certain propositions or observations.
1) The language allows you to emphasise either the object or the subject. Either way, though, both a passive and an active version of a given sentence can hide or tell some information equally. Compare:
The pizza was eaten.
Somebody ate the pizza. (The amount of info these sentences give is practically equivalent.)
It's more about the author, whether or not he wants to tell something to the reader.
2) Passive need not be formal in all its uses, nor does every text need be formal and accessible, and a formal text is not necessarily inaccessible.
3) That's a crazy nitpicking and a silly exaggeration. Copula-heavy text is boring to read, but while the copula verb and the auxiliary verb for passive forms are the same (to be), in its second role, it is not also acting as a copula. The verb 'to be' is not the copula, but one of its uses is as the copula. So if one wants to give up on copula, however mad that may be, he need not give up on all the uses of the verb to be. That said, if it is an artistic choice to avoid copula to the extent possible, I can't really criticise that. It can't be affirmed as a general rule though.
Edit: Oh, also, in a sentence like "Bob seems terrible.", 'to seem' is basically a copula. Copula is basically any verb that links the subject to a predicative.
Thanks for responding.
> [...] while the copula verb and the auxiliary verb for passive forms are the same (to be), in its second role, it is not also acting as a copula. The verb 'to be' is not the copula, but one of its uses is as the copula. So if one wants to give up on copula, however mad that may be, he need not give up on all the uses of the verb to be.
I agree that E-Prime users should try to distinguish between copulative and non-copulative uses of "to be" and that passives are non-copulative. By mentioning E-Prime, I was just trying to draw an analogy with another way of restricting language in the name of "taking responsibility".
> Edit: Oh, also, in a sentence like "Bob seems terrible.", 'to seem' is basically a copula. Copula is basically any verb that links the subject to a predicative.
According to E-Prime users, using "seems" instead of "is" could typically make the scope and basis for disagreements clearer (because then you can talk more readily about to whom something seems a certain way?).
The passive voice prohibition is more of a lazy pedagogical tool than sound style advice. Nothing wrong with using it, but it's often used poorly, and it's easier to say don't use it at all than to explain how to use it well.
My favourite "style guide" is Clear And Simple As The Truth: Writing Classic Prose by Francis-Noël Thomas & Mark Turner, which takes the time to explain what it means by "style" and has almost nothing to say about passive voice and adverbs.
> There are times when the passive voice is acceptable in technical writing.
> I also believe, as with adverbs, that removal of the passive voice would have been a net improvement for over half the technical writing I've edited. (That is, students abuse the passive voice more often than they use it well.)
The author himself is not against passive voice. He simply has not found that students have used it appropriately.
I myself was a bit humored by the way in which this article, while probably well founded, probably violates some of its own advice in that it is not backing up claims with data and facts, but generalizations which have come from personal experience.
That's just ONE counter source. Hardly enough to make the case.
While there might be nothing "fundamentally wrong with passive voice, or adverbs, or any of the other things that he mentions", there is a lot that's fundamentally wrong with how those things are abused by the majority of people.
Agreed, the scripts can use improvements like these. Its a start.
I'd also add 'but' if its not there yet. Its function is to negate everything written before it which easily leads to fallacies.
> I'm not sure why 'very close match' is any more opinionated than 'close match' is.
Because 'close' in 'close match' is informative. Without 'close' you get 'match'. So close tells us about the state of the match.
Very is redundant at best. Very is also emotional, its function is to (consciously or not) attempt to induce an emotional response in the reader; ie. to manipulate the reader. You want to avoid all of the above in a scientific paper.
Its important to note that we can reach for perfection whilst writing. Because such a goal is far fetched it makes more sense to improve ourselves via iterations. (Same with these scripts, or software development in general.)
>> Benjamin Beckwith has contributed a "writegood" mode for emacs inspired by these scripts.
This is going into my .emacs right now.
We've had spellcheckers for decades but I find it really surprising that automated grammar and proofreading checkers aren't in common use yet. For example, having my email client highlight overly long sentences, duplicate words, ambiguous references (e.g. what noun does "it" refer to) and more would undoubtable save proofreading time and doesn't sounds that difficult to implement. I see online comments every few days of someone pointing out the word loose/lose is used incorrectly for instance.
I recall that many grammar checkers suffer from false positives though but has the technology not advanced?
offline grammar checkers: https://www.serenity-software.com & http://www.editorsoftware.com/StyleWriter.html
having my email client highlight overly long sentences, duplicate words, ambiguous references (e.g. what noun does "it" refer to) and more would undoubtable save proofreading time and doesn't sounds that difficult to implement.
While it's geared a bit more for the legal field, WordRake does a good job of finding many of these mistakes. It works as an Add-in for Word or Outlook. It's good for finding instances where you use 5 words when 2 would have been better. It will analyze a chunk of text, find clunky chunks, and give a suggestion which you can accept or reject. I find even if the suggestion isn't a good one, it's a bad sentence which needs to be reworked.Because the intent of a sentence is not always known, there is no Accept All button.
Disclaimer: I have received a free year license, but not in exchange for writing this.
You can find the instructions to do the test (and some good examples) in the book Writing your journal article in twelve weeks: A guide to academic publishing success.
The script and its documentation are here:
https://github.com/carlobar/BDT_latex https://github.com/carlobar/BDT_latex/blob/master/docs/docum...
> Bad: We used various methods to isolate four samples. > Better: We isolated four samples.
The first sentence is right if a different method was used to obtain different samples. This is relevant information
Secondly, there is a difference in context, timing and tone in an article like this. Here, a PhD supervisor is speaking generally about the sorts of errors his students tend to make.
In your situation, you were "attacking" a single person publicly. If you had had the social grace to make your comments privately and in person (rather than in a chatroom) they probably would have been better received.
If your takeaway from this post is just to "ignore the haters" then I'm afraid you're missing out on some real opportunity for self-improvement.
But yes, "note that" is a bugaboo I have to battle in my own writing. With rare exceptions it can just be deleted; occasionally it indicates that the following point deserves more emphasis than I have given it.
I would be great if someone could enhance the programs `style` and `diction` [1] to incorporate these hints. And make a browser add-in for good measure!
I used `diction` religiously back when I used a UNIX System V system -- it helped me a lot.
ack -C -i 'tk|to ?do|lorem|fu.k|shit|wt[fh]|[!?.]{3,}'
Maybe the OP's goal is to have his phds practice more shell scripting and syntax. But it seems the same effect could be achieved with grep and the flag to filter from a file of patterns, rather than creating an unwieldy single string to enumerate all the possible words. Instead of having to write if/else logic to provide a lackluster CLI, have students create a repo of weasel words and use git clone/curl with grep.I didn't read through his third script for detecting duplicate words, but couldn't it be achieved by using PCRE regex and backreferences?
http://stackoverflow.com/questions/2823016/regular-expressio...
Off-topic, but I've been meaning to write a post on how learning the command-line made me a significantly more productive writer. I do most of my writing on sites built from static site generators, such as Jekyll and Middleman and Sphinx. For many of my tutorials, I have to describe graphical elements which require taking screenshots.
I of course know the OSX keyboard shortcut to turn on the screen grab utility and interactively make a selection. But this saves the screenshot to a default location with a generic file name. To include that image in my blog, I have to move it over to my working directory, rename it, and then write the img code and src attribute to my blog post. It's enough annoying small steps that including images in my posts was a huge chore.
Sometime ago, this blog post on OS X Terminal Utilities [0] made it to HN's front page and I learned that screencapture could be invoked from the Terminal. So I wrote a little Ruby wrapper that, when invoked from the command-line with an argument for output path, would call screencapture after a 2-second delay -- enough time for me to Cmd-Tab from a Terminal to the application I want to screensnap -- and then save the snap to the specified destination and output HTML/Markdown that I could paste into my blogpost.
Sample usage:
$ screenpy images/path/to/screenshot.jpg
stderr: Writing to: images/path/to/screenshot.jpg
Format: jpeg
quality: 75
optimize: True

stdout: <img src="images/path/to/screenshot.jpg" alt="screenshot.jpg">
I've iterated the tool, converting it to Python and including the was-sdk so I could upload to S3 if I need an absolute URL. And I've written plenty of other utilities since...but it's hard to overstate how much being able to operate via CLI has smoothed my writing experience. It's not just that it saves me time, but I'll write visual-heavy posts that I would have never even tried, especially back in my Wordpress days.[0] http://www.mitchchn.me/2014/os-x-terminal/
[1] https://gist.github.com/dannguyen/bfb45408d43986eefdf83b59bc...
And you're proudly shell scripting. :)
On Writing Well by William Zinsser