TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Shell scripts to improve your writing

219 点作者 jaybosamiya超过 8 年前

17 条评论

erlehmann_超过 8 年前
There is also GNU style and GNU diction: <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;diction&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;diction&#x2F;</a><p>; cat &lt;&lt;EOF &gt;&#x2F;tmp&#x2F;testfile<p>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.<p>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.<p>EOF<p>; LANG=C diction --lang en --suggest &#x2F;tmp&#x2F;testfile<p>&#x2F;tmp&#x2F;testfile:2: These programs cannot help you structure a document well, but [they -&gt; (do not use as substitute for &quot;each, each one, everybody, every one, anybody, any one, somebody, some one&quot;)] [can -&gt; (do not confuse with &quot;may&quot;)] help to avoid poor wording and [compare -&gt; &quot;Compare&quot; to points out resemblances, &quot;compare with&quot; points out differences.] the readability (not the understandability!) of your documents with others.<p>3 phrases in 5 sentences found.
评论 #13301847 未加载
empath75超过 8 年前
Nobody should be using Strunk and White as a style guide after primary school. There&#x27;s nothing fundamentally wrong with passive voice, or adverbs, or any of the other things that he mentions here.<p><a href="http:&#x2F;&#x2F;www.chronicle.com&#x2F;article&#x2F;50-Years-of-Stupid-Grammar&#x2F;25497" rel="nofollow">http:&#x2F;&#x2F;www.chronicle.com&#x2F;article&#x2F;50-Years-of-Stupid-Grammar&#x2F;...</a><p>He doesn&#x27;t even correctly identify what weasel words are. (&quot;Some people say&quot;, &quot;It is believed&quot;, etc). I&#x27;m not sure why &#x27;very close match&#x27; is any more opinionated than &#x27;close match&#x27; is. It&#x27;s not as if the latter is precisely defined.
评论 #13297137 未加载
评论 #13298852 未加载
评论 #13297897 未加载
评论 #13297718 未加载
评论 #13301517 未加载
评论 #13301447 未加载
评论 #13298659 未加载
randomstring超过 8 年前
I read the whole article thinking &quot;this needs to be an emacs mode!&quot; only to get to the punchline at the bottom.<p>&gt;&gt; Benjamin Beckwith has contributed a &quot;writegood&quot; mode for emacs inspired by these scripts.<p>This is going into my .emacs right now.
评论 #13298501 未加载
评论 #13299068 未加载
seanwilson超过 8 年前
Is there anything like this for Google Docs, Gmail or Atom?<p>We&#x27;ve had spellcheckers for decades but I find it really surprising that automated grammar and proofreading checkers aren&#x27;t in common use yet. For example, having my email client highlight overly long sentences, duplicate words, ambiguous references (e.g. what noun does &quot;it&quot; refer to) and more would undoubtable save proofreading time and doesn&#x27;t sounds that difficult to implement. I see online comments every few days of someone pointing out the word loose&#x2F;lose is used incorrectly for instance.<p>I recall that many grammar checkers suffer from false positives though but has the technology not advanced?
评论 #13306144 未加载
评论 #13296783 未加载
评论 #13296836 未加载
评论 #13297039 未加载
评论 #13304752 未加载
评论 #13297042 未加载
评论 #13297040 未加载
carlosbarreto超过 8 年前
Hello, I wrote similar script to do the Belcher diagnostic test in LaTeX documents. This test consists in highlighting parts of the text with potential problems (e.g., vague pronouns, weak verbs, and passive voice, among others).<p>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.<p>The script and its documentation are here:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;carlobar&#x2F;BDT_latex" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;carlobar&#x2F;BDT_latex</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;carlobar&#x2F;BDT_latex&#x2F;blob&#x2F;master&#x2F;docs&#x2F;documentation.pdf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;carlobar&#x2F;BDT_latex&#x2F;blob&#x2F;master&#x2F;docs&#x2F;docum...</a>
mrob超过 8 年前
You may also be interested in LanguageTool, which catches many potential problems in several languages. It&#x27;s the best Free Software style and grammar checker I&#x27;ve seen:<p><a href="https:&#x2F;&#x2F;languagetool.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;languagetool.org&#x2F;</a>
killercup超过 8 年前
Oh, that reminds me: I rewrote that bash script (and a bit more) as a Rust lib (+ CLI) for fun last year. If anyone wants to build on it: <a href="https:&#x2F;&#x2F;github.com&#x2F;killercup&#x2F;english-lint" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;killercup&#x2F;english-lint</a>
raverbashing超过 8 年前
Looks like good guidelines overall, I just have one complaint<p>&gt; Bad: We used various methods to isolate four samples. &gt; Better: We isolated four samples.<p>The first sentence is right if a different method was used to obtain different samples. This is relevant information
评论 #13297370 未加载
评论 #13297344 未加载
sdegutis超过 8 年前
So, on a related note, someone wrote a blog post a few years ago that just perfectly epitomized the annoyingly pretentious writing style everyone in the tech world seems to have, and I recommended to him that he use simpler phrases and words and sentences. Everyone in that chatroom criticized me as both an idiot and an asshole. Skip ahead a year or two, and PG writes the same fucking thing in a blog post and posts it here, and everyone praises him. What I took from this is that I&#x27;m not actually an idiot after all, and I should probably stop listening to people who say that I am.
评论 #13297362 未加载
评论 #13296720 未加载
评论 #13297097 未加载
评论 #13297462 未加载
ScottBurson超过 8 年前
In the footnote, what is that comma after &quot;Regehr&quot; doing there? Delete it!<p>But yes, &quot;note that&quot; 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.
feld超过 8 年前
I&#x27;ve kept these in my GitHub for a while now<p><a href="https:&#x2F;&#x2F;github.com&#x2F;feld&#x2F;technical-writing" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;feld&#x2F;technical-writing</a>
emmelaich超过 8 年前
[edit: I see @erlehmann_ beat me to it but am leaving it here anyway]<p>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!<p>I used `diction` religiously back when I used a UNIX System V system -- it helped me a lot.<p>1. <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;diction&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;diction&#x2F;</a>
5706906c06c超过 8 年前
Love this! English is my third language; I often fall for using passive voice, adverbs or fillers. Much like this script, I found Grammarly to be extremely helpful in forcing me to rethink the above when composing.
danso超过 8 年前
I do something similar to the OP. When I&#x27;m working on a long project with multiple pieces that I might have left incomplete, I&#x27;ll use a grep-like (like ack, which has PCRE) to quickly look for placeholders or cusswords:<p><pre><code> ack -C -i &#x27;tk|to ?do|lorem|fu.k|shit|wt[fh]|[!?.]{3,}&#x27; </code></pre> Maybe the OP&#x27;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&#x2F;else logic to provide a lackluster CLI, have students create a repo of weasel words and use git clone&#x2F;curl with grep.<p>I didn&#x27;t read through his third script for detecting duplicate words, but couldn&#x27;t it be achieved by using PCRE regex and backreferences?<p><a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;2823016&#x2F;regular-expression-for-consecutive-duplicate-words" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;2823016&#x2F;regular-expressio...</a><p>Off-topic, but I&#x27;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.<p>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&#x27;s enough annoying small steps that including images in my posts was a huge chore.<p>Sometime ago, this blog post on OS X Terminal Utilities [0] made it to HN&#x27;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&#x2F;Markdown that I could paste into my blogpost.<p>Sample usage:<p><pre><code> $ screenpy images&#x2F;path&#x2F;to&#x2F;screenshot.jpg </code></pre> stderr:<p><pre><code> Writing to: images&#x2F;path&#x2F;to&#x2F;screenshot.jpg Format: jpeg quality: 75 optimize: True ![image screenshot.jpg](images&#x2F;path&#x2F;to&#x2F;screenshot.jpg) </code></pre> stdout:<p><pre><code> &lt;img src=&quot;images&#x2F;path&#x2F;to&#x2F;screenshot.jpg&quot; alt=&quot;screenshot.jpg&quot;&gt; </code></pre> I&#x27;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&#x27;ve written plenty of other utilities since...but it&#x27;s hard to overstate how much being able to operate via CLI has smoothed my writing experience. It&#x27;s not just that it saves me time, but I&#x27;ll write visual-heavy posts that I would have never even tried, especially back in my Wordpress days.<p>[0] <a href="http:&#x2F;&#x2F;www.mitchchn.me&#x2F;2014&#x2F;os-x-terminal&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.mitchchn.me&#x2F;2014&#x2F;os-x-terminal&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;dannguyen&#x2F;bfb45408d43986eefdf83b59bc9e8629" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;dannguyen&#x2F;bfb45408d43986eefdf83b59bc...</a>
评论 #13296847 未加载
kazinator超过 8 年前
&gt; <i>My Ph.D. advisor, Olin Shivers, ...</i><p>And you&#x27;re proudly shell scripting. :)
plg超过 8 年前
A fantastic book for improving your writing:<p>On Writing Well by William Zinsser
BuuQu9hu超过 8 年前
Another similar tool: <a href="http:&#x2F;&#x2F;proselint.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;proselint.com&#x2F;</a>