Count sentences in a text.
Naive sentence counting splits on full stops and gets the answer wrong, because abbreviations like Dr. and Prof. and decimals like 3.5 contain full stops that do not end sentences. This counter protects those patterns before splitting, which typically corrects the count by several percent on technical prose. The count itself matters less than what it enables: average sentence length is one of the two inputs to every readability formula, and the count of sentences exceeding a threshold is more actionable than the average, since a handful of very long sentences is what actually makes prose hard to follow.
Sentence detection
Protect abbreviations and decimals, then split on terminal punctuation
Average length
Average = total words / sentences counted
Because the full stop in Dr. or etc. is identical to a terminal full stop as far as a simple split is concerned. On text with many abbreviations or numeric values a naive count can overstate sentences by 10 percent or more, which then understates average sentence length.
Around 15 to 20 words for general prose. What matters more is variation — uniform 18-word sentences read monotonously. Mix short sentences for emphasis with longer ones for development, and watch the count exceeding 30 words rather than the mean alone.