Where Does a Sentence End? — The Limits of Rule-Based Sentence Splitting
Counting sentences feels obvious to a human, but it's a trickier problem for a computer than it looks. Deciding whether a period ends a sentence first requires figuring out whether that period is actually a sentence terminator, or just part of an abbreviation, a decimal point, or an ellipsis. This problem is called Sentence Boundary Detection (SBD), and in natural language processing (NLP) it's still considered an area that isn't fully solved. This guide breaks down where and why a lightweight, regex-based sentence splitter gets it wrong — and separates the cases where that actually matters from the cases where it doesn't.
1. The abbreviation trap: why "Dr. Kim" gets cut into two sentences
The most common SBD failure in English text is abbreviations. Split the single sentence "Dr. Kim went to the U.S. yesterday." using a regex that breaks on periods, and the periods after "Dr." and "U.S." can be mistaken for sentence endings too, splitting it into as many as 3 sentences. A human instantly knows from context that "Dr." is short for "Doctor," but a simple rule like "does a capital letter follow the period" can't distinguish an abbreviation like "Mr.", "Ms.", "vs.", or "etc." from an actual sentence ending. Sophisticated SBD engines pre-register dictionaries of hundreds of abbreviations to handle these as exceptions, but they can still fail on abbreviations not in the dictionary — new coinages or proper-noun abbreviations like "Inc." or "Ph.D."
2. Decimals and ellipses: when a period is used for a number or an emotional pause
Decimal notation like "3.14," and ellipses used for trailing-off speech, are also traps for regex-based splitters. Without special handling for whether a digit follows the period, or whether three periods appear in a row, a sentence like "3.14 is pi." can get split into "3" and "14 is pi." This is especially a problem with report or news text full of figures and statistics — feed that kind of text into a splitter and these mis-splits accumulate, producing a sentence count far higher than the real one.
3. Korean sentence punctuation and how this tool actually handles it
Here's how the splitting logic in MODOO HUB's Sentence Counter tool actually works. It first normalizes all whitespace and line breaks into single spaces, then cuts the text using the regex /[^.!?。!?]+[.!?。!?]+/g, which breaks on periods (.), exclamation points (!), question marks (?), and their full-width equivalents (。!?). In other words, it looks at zero surrounding context around the terminal punctuation and cuts purely on the character itself. There's no abbreviation dictionary or decimal-point exception handling built in, so feeding it the "Dr. Kim" or "3.14" examples above genuinely does produce over-splitting. Conversely, Korean often ends a clause with a sentence-final ending (like "-다," "-요," "-까") without any period at all, so a punctuation-based splitter can actually undercount (count too few sentences) on conversational Korean text.
4. Why a trailing fragment with no terminal punctuation isn't just discarded
After the regex matching finishes, this tool's split function (splitSentences) checks for any leftover text (rest) and, even if it has no terminal punctuation, appends it as the final sentence. This design exists to prevent losing the last sentence entirely in a draft where the writer forgot the final period, in conversational text, or in something like an SNS post where dropping the terminal punctuation is common. That said, it also means a fragment that's literally just one leftover word can get counted as a "sentence" — worth keeping in mind when reading derived statistics like average words per sentence.
5. How do dedicated NLP libraries do it differently?
English NLP libraries like spaCy and NLTK combine rules with statistical models, factoring in abbreviation dictionaries, surrounding capitalization, and part-of-speech information to judge sentence boundaries. For Korean, tools built around kss (Korean Sentence Splitter) or linked to KoNLPy use morphological analysis results to distinguish sentence-final endings, quotation marks, and sentences inside parentheses, splitting far more precisely. These libraries are heavy, since they carry trained models or thousands of built-in rule exceptions, which makes them a real burden to run in real time in a browser. A lightweight regex-based splitter like this tool, by contrast, trades some accuracy on edge cases like abbreviations and decimal points for instant response. That's plenty for everyday writing analysis and draft review, but if you need a precise sentence count on text dense with abbreviations and numbers — like an academic paper or legal document — you should keep this limitation in mind.
FAQ
Q. Why does an abbreviation like "Dr. Kim" inflate the sentence count?
A. This tool splits sentences with a regex that only looks at the period, exclamation point, or question mark character itself, so it can't distinguish a period after an abbreviation from a period that truly ends a sentence. The more abbreviations an English text has, the more the count can run above the true number of sentences.
Q. What happens if I enter a number with a decimal point?
A. A period used as a decimal point, as in "3.14," can also be mistaken for a sentence ending and cause a split. For text dense with statistics or figures, it's safer to treat the result as a rough reference rather than trusting it outright.
Q. How is a sentence with no terminal punctuation handled?
A. Even a trailing fragment with no terminal punctuation is recognized as one sentence and included in the stats and sentence list. This is by design, to keep the last sentence from being dropped in a draft that forgot the final period or in conversational text.
Q. What tool should I use if I need more accurate sentence splitting?
A. For precise analysis of text dense with abbreviations and numbers — academic papers, legal documents — a tool built on a dedicated NLP library like spaCy or NLTK (for English) or kss/KoNLPy (for Korean) will be more accurate. This tool is best suited for quick draft checks and getting a feel for writing rhythm.