Word count within sentences
December 11, 2018 6:20 AM   Subscribe

I am doing some branded content work where for SEO reasons sentences need to be 20 words and under. I would like a website, app, etc where I can post my copy into a window or something, click a button, and it highlights either entire sentences that are too long, or highlights from the point they exceed the sentence word count.
posted by Mistress to Writing & Language (4 answers total) 2 users marked this as a favorite
 
Word Counter is pretty customizable, you ought to be able to get it to do this.

If you're treating a "sentence" as just any sequence of words ending in a final punctuation mark, this would also be pretty trivial in a modern scripting language: python example.
posted by aspersioncast at 7:09 AM on December 11, 2018


How are you at spreadsheet wrangling? To do this at my company, we use a Google spreadsheet formula that counts the number of spaces in a particular cell. You can also count characters, which is useful for writing meta descriptions and so on.
posted by third word on a random page at 8:21 AM on December 11, 2018


I use Hemingway App for similar purposes. You just paste your text into it and it hightlights several writing problems, including hard to read sentences. It doesn't have a hard sentence word limit, but it'll definitely draw your attention to stuff that needs work.
posted by entropone at 8:28 AM on December 11, 2018


If this is a very hard requirement you probably want a python script, but if it's just to do a quick look-over you can do a decent job with a regular expression. I whipped up a little one that can probably handle most typically-formatted text. Here it is.

Similar to the spreadsheet solution, all it does highlight any series of characters that have lots of spaces in them (tabs count too) and a period or question mark at the end. It's pretty simple so it might get a little confused by stuff like hyphens.

Some text editors may have the ability to do a "find" based on a regular expression.
posted by one of these days at 10:53 AM on December 11, 2018 [1 favorite]


« Older Rugs: Upgrade Pick.   |   Bitter Tea Newer »
This thread is closed to new comments.