Live data from Hacker News

Writing one sentence per line

sive.rs

271–280 of 307 posts

Re: Writing one sentence per line

#271
post #238

Earlier quoted context omitted.

There is! If you're using Git, you can do git diff --word-diff to enable word mode, which is computationally more expensive, but computing power is cheap these days. There's also an "ignore whitespace" mode ( -w ), though that doesn't play well with Python.

Cool! An example: You are in a maze of twisty little passages, all different. You are in a little maze of twisty passages, all different. You are in a little maze of twisting passages, all different. You are in a maze of twisty little passages, all different. You are in a[-little-] maze of twisty {+little+} passages, all different. You are in a[-little-] maze of [-twisting-]{+twisty little+} passages, all different.…

Plugh

Re: Writing one sentence per line

#272
post #209

One big advantage not mentioned in the article particularly relevant to this audience: git diffs (or your VCS of choice). One sentence per line means diffs will operate per-sentence, rather than per-paragraph. This way the diff can capture the restructuring of the paragraph (adding/removing/replacing a sentence), which gives much more insight than swapping out the paragraph wholesale. It also means minor changes (e.g…

I also use one clause per line in long sentences. It makes it easier to try different ways of structuring the same information. You can do major edits with little more than whole-line copy and paste, capitalization changes at line beginnings, and punctuation changes at line endings -- all of which are easy in vim (dd/p, 0~, $r/$x/A)

Re: Writing one sentence per line

#273
post #212

Earlier quoted context omitted.

>So it isn't true that most advice suggests writing for eight year olds. That may be true although I can tell you from personal experience that writing optimizers for places like trade press sites absolutely push you towards more basic language, shorter sentences, etc. One site in particular I used to write for sometimes told me every single time that I should basically dumb down my prose. And I don't write in a part…

I think you’re both making good points in this thread. I’m writing a non-fiction book in my spare time, and I’ve had to face the fact that my default get-words-on-the-page is extremely flowery. Would it be possible for you share an example of your prose that received this criticism?

Basically anything here had the Wordpress plug-in whining:

https://www.techtarget.com/contributor/Gordon-Haff

And that's probably after I made a few token changes to make the plug-in happier.

Re: Writing one sentence per line

#274

Earlier quoted context omitted.

Some people might prefer two spaces, but my understanding is that all authorities on “good typography” have standardized on one space: https://practicaltypography.com/one-space-between-sentences....

Rendering engines can do anything they want. The question is about source representation only, for semantic purposes. That has nothing to do with output representation. Even practicaltypography completely misses that distinction. You wouldn't publish anything with line breaks between sentences either. Double spacing or line breaks both work nicely for semantic purposes because html (or markdown which almost always en…

GP:

> Good typography seems to dictate a wider space after a sentence than between words.

You:

> Rendering engines can do anything they want. The question is about source representation only, for semantic purposes.

The thread you’ve commented on is literally about rendering, not source representation and semantics. I agree that you can use a double-space as a sentence delimiter, but we’re currently discussing whether it’s “good typography” to render it that way.

Re: Writing one sentence per line

#275

Earlier quoted context omitted.

Good typography seems to dictate a wider space after a sentence than between words. So this is a typewriter habit to mimic that kind of thing (like the sibling noted).

Some people might prefer two spaces, but my understanding is that all authorities on “good typography” have standardized on one space: https://practicaltypography.com/one-space-between-sentences....

Take a ruler to some text that's traditionally typeset and you'll notice that the width of the whitespace after a sentence end is slightly wider than the space between words. That's either an em space or an en quad. Between-word spacing would be about 1/2 an en.

Studies examining whether or not wider spacing between sentences improved readability have been inconclusive.

There is one good reason to use two spaces between sentences, at least for text that's going to be processed automatically. It can be very difficult for software to know whether a given punctuation mark is the end of a sentence or something else, like an abbreviation. GNU Emacs, for example, is (or was) coded to recognize sentences by looking for two spaces after a ., ?, or !.[1]

1 https://www.gnu.org/software/emacs/manual/html_node/emacs/Se...

Re: Writing one sentence per line

#276

Earlier quoted context omitted.

Two spaces between sentences is how I've always typed them, even if it's in HTML or MD or other forms that will condense them into a single space in the final render. The two spaces mark a clear intent to end a sentence instead of a period to punctuate an abbreviation.

I've seen two spaces listed as a "resumé don't-do" cos it marks you as an oldster.

I am an oldster, but never used two spaces. Probably because I never did typing lessons at school (hell I don't think it was even an option at my schools - computers hardly featured either).

Re: Writing one sentence per line

#277
post #209

One big advantage not mentioned in the article particularly relevant to this audience: git diffs (or your VCS of choice). One sentence per line means diffs will operate per-sentence, rather than per-paragraph. This way the diff can capture the restructuring of the paragraph (adding/removing/replacing a sentence), which gives much more insight than swapping out the paragraph wholesale. It also means minor changes (e.g…

I think we need to start changing this. In an era of language servers, perhaps our diff tools should be semantic instead of line based. I get so tired of seeing diffs where I add a function and the diff shows that I added it inside the previous function instead of between them, because it starts the diff one line too early.

I recently switched my git diff viewer to difftastic, which does semantic diffing. It works pretty well, though it's only useful for viewing diffs, not generating patches.

Re: Writing one sentence per line

#278

Earlier quoted context omitted.

Rendering engines can do anything they want. The question is about source representation only, for semantic purposes. That has nothing to do with output representation. Even practicaltypography completely misses that distinction. You wouldn't publish anything with line breaks between sentences either. Double spacing or line breaks both work nicely for semantic purposes because html (or markdown which almost always en…

GP: > Good typography seems to dictate a wider space after a sentence than between words. You: > Rendering engines can do anything they want. The question is about source representation only, for semantic purposes. The thread you’ve commented on is literally about rendering, not source representation and semantics. I agree that you can use a double-space as a sentence delimiter, but we’re currently discussing whether…

Your reply cited Butterick which doesn't distinguish the two issues. Every "authority" I've seen strongly admonish against the use of two spaces fails to make this distinction. Which is why I emphasized it.

I don't think there's much dispute that two spaces is too much in modern properly rendered prose, so I don't know who "we" is. (And anyone who does think two word spaces is just fine, would probably also agree that it should be configurable and not dependent on two spaces in the source text.)

If there's a text renderer out there that renders two spaces as two word spaces in prose, that should be patched, not writers' brains.

Re: Writing one sentence per line

#279
post #209

One big advantage not mentioned in the article particularly relevant to this audience: git diffs (or your VCS of choice). One sentence per line means diffs will operate per-sentence, rather than per-paragraph. This way the diff can capture the restructuring of the paragraph (adding/removing/replacing a sentence), which gives much more insight than swapping out the paragraph wholesale. It also means minor changes (e.g…

You could write normally and then split on sentence boundaries with any NLP tool. Then pipe the output into a diff. Don't format your writing to suit your tools.

Hacker news today says that OpenNLP 2.0 just came out. That should work.

Re: Writing one sentence per line

#280

Earlier quoted context omitted.

You could write a script which replaces the end of sentences with a new line and use git hooks[0] to run it before every commit. You wouldn't have to write any differently. 0. https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

This would require accurately detecting the end of the sentence which is not an easy thing to do correctly consistently.

No, but NLP toolkits like opennlp already do this quite well.
Post reply on HN