Can one write a tree-sitter grammar for English (or any other natural language), that basically labels each sentence as a statement, so I can use difftastic to show changes on sentences rather than visual lines?
This is because visual line diffs for an essay is bonkers. Usually the sentence changed starts in the middle of a visual line.
The common advice[0] is to just write one sentence per line. I usually split at commas etc as well. Then use editor soft wrapping instead of fixing a maximum line length - but if your lines get longer than the screen width that might be a sign your sentences are too complex.
[0]: anyone have a good source for this? I’m not sure where I first encountered it
I will write excessively complex sentences whenever I darn please, and will be hogtied before I stop at the whims of a /diff tool/.
Mock outrage aside, whimsy and play in written language is vastly cheaper than in industrial programming environments. Provided, of course, the author can yet communicate while horsing around.
It turns out that there is a lot of discourse out there about "semantic
newlines", under a few different names. So far the names I've seen are:
- One Sentence Per Line (OSPL)
- Semantic Line Breaks (SemBr)
- Semantic Linefeeds
- Ventilated Prose
- Semantic newlines
Reading through the pages below was helpful in getting a better idea of
what language people use to discuss this. They're mostly historical
retrospectives or arguments for the merit of semantic newlines.
And often there is a middleground. In this case one could write a script that outputs a reformatted file with one sentence per line.
In Vim this could even be a simple macro as the editor already has a key for jumping to the next sentence.
This is because visual line diffs for an essay is bonkers. Usually the sentence changed starts in the middle of a visual line.