7 ms·
> diffs make way more sense when there is only one sentence per line I did the same thing for some time for papers at university for the same reason. It used t
by ketzu 4y ago
> diffs make way more sense when there is only one sentence per line
I did the same thing for some time for papers at university for the same reason. It used to annoy me, because I hate to change for my tools, I rather have my tools support my workflow: There should be a nicer diff for that.
- TheFreim 4y agoYou 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 https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
- michaelmior 4y agoThis would require accurately detecting the end of the sentence which is not an easy thing to do correctly consistently.
- deleted 4y ago[deleted]
- dubya 4y agoTwo spaces between sentences makes this easy, and should be just as easy a habit as one sentence per line.
- kadoban 4y agoThat's about as unnatural for most people as newline per sentence, and has the added risk that you'll accidentally publish like that and it'll look weird. One per line would be _much_ harder to accidentally publish because it's more obvious.
- BeFlatXIII 4y agoTwo 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.
- TheFreim 4y agoMany people learned to add two spaces to the end of each sentence which is now built in to their muscle memory. My father learned to type adding two spaces to the end of every sentence, they tried to teach that to me in computer class in middle school but since I had a lot of experience typing already without it I never felt motivated to change my habit to add two spaces. I never really saw the point, in most formats I can't see the two spaces.
- wongarsu 4y agoTwo spaces after each sentence comes from typewriters, where it supposedly looked better. On computers it made sense in the time of monospaced fonts, but with "modern" fonts being able to control the amount of space behind punctuation it's largely redundant.
- blowski 4y agoExcept for when you want to do diffs at the end of a sentence.
- avgcorrection 4y agoGood 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).
- jhardy54 4y agoSome 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.html https://practicaltypography.com/one-space-between-sentences....
- avgcorrection 4y agoI used to write like that (even though I’m not an American or a former typewriter) but pressing double space got annoying after a while. :-)
- _tom_ 4y agoNo, but NLP toolkits like opennlp already do this quite well.
- michaelmior 4y agoFair point, but I still prefer the solution of just putting in a new line myself. Then I don't have to worry about maintaining such a script, setting up the git hook, etc.
- m4lvin 4y agogit diff --word-diff
- deleted 4y ago[deleted]
- fragmede 4y agoThere 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.
- deleted 4y ago[deleted]
- irq-1 4y agoCool! 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. You are in a {+little+} 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-]{+twisty+} passages, all different. You are in a {+little+} maze of [-twisty little-]{+twisting+} passages, all different. You are in a little maze of [-twisty-]{+twisting+} passages, all different. You are in a little maze of twisting passages, all different.
- cratermoon 4y agoPlugh
- ketzu 4y agoThank you, that's a nice feature. I hope I won't forget it until I need it again.