The Problem with Naive Text Converters
Most online text utilities and case converters are built with a single naive regular expression: split text whenever a period (.), exclamation mark (!), or question mark (?) appears, and capitalize the next character.
While this approach works for basic kindergarten sentences, it causes catastrophic data corruption in real-world writing containing web links, currency amounts, measurement decimals, abbreviations, and ellipses. Worse, these errors occur quietly without warning—leaving the writer with broken links and corrupted prices in published articles.
The 5 Text Corruption Bugs We Test Against
| Case / Scenario | What Other Tools Output ❌ | What Text Cleaner Outputs ✅ |
|---|---|---|
| 1. Decimals & Currencies | Total is $9. 99 for 1. 5 lbs (Splits numbers and inserts spaces) |
Total is $9.99 for 1.5 lbs (Preserves numerical decimals) |
| 2. Web URLs & Domains | Check our site at acme. Com today (Capitalizes domain extensions) |
Check our site at acme.com today (Keeps URLs lowercase) |
| 3. Trailing Punctuation | This is the end of the text (Deletes the final period) |
This is the end of the text. (Strictly preserves trailing marks) |
| 4. Ellipses (Three Dots) | Wait for it. Next sentence (Collapses ... to .) |
Wait for it... Next sentence (Keeps full three-dot ellipses) |
| 5. Dotted Abbreviations | Living in the U. S. A. With e. G. Options (Splits acronyms into letters) |
Living in the U.S.A. with e.g. options (Preserves abbreviation casing) |
How Our Engine Solves Sentence Boundary Detection
Text Cleaner uses an advanced, token-aware sentence boundary detection algorithm in both our Swift native app and our client-side JavaScript engine:
- Lookahead & Lookbehind Validation: Punctuation marks are only treated as sentence terminators if they are followed by whitespace and are not adjacent to digits, domain suffixes, or known acronym patterns.
- Zero Character Loss (Idempotency): Running sentence case or paste repair repeatedly over the same text produces the exact same output without losing characters, commas, or spaces.
- Automated Test Coverage: Every single one of these 5 corruption scenarios is covered by automated unit tests in our public test suite (
test/transforms.test.mjsandTextTransformTests.swift).
Test It Live
Use the interactive converter above to test our sentence case engine on URLs, prices, and abbreviations. See how it cleanly capitalizes sentences without altering a single decimal or link.