ETEvoraTools
Text Analysis

Sentence Counter

Sentence Counter uses a regex that groups non-.!? text followed by one or more terminal marks, plus a final remainder, then counts nonblank matches. It does not understand abbreviations, initials, decimal numbers, ellipses, quotations, headings, language-specific punctuation, or sentence boundaries without those ASCII marks. It is a rough estimate, not linguistic segmentation.

Runs locally — files stay on your device
Quick answer

Will abbreviations affect the count?

Yes. Periods in abbreviations can create extra matches.

Sentence detection needs language and abbreviation context

Punctuation is only one signal; tokenization and language rules decide whether a boundary is genuine.

How it works

A global regex finds punctuation-terminated chunks or the final remainder and filters whitespace-only matches.

Key concepts

Multiple marks are one ending

?! is consumed in the same terminal run.

Final remainder counts

A last sentence need not end with punctuation.

When to use it

  • Get a rough count for ordinary punctuated prose.
  • Compare drafts under one heuristic.
  • Spot extremely long punctuation-free sections.

When not to use it

  • Do not use for legal/editorial certified counts.
  • Do not expect abbreviation handling.
  • Do not expect multilingual sentence terminators.

Worked examples

Simple

Input
One. Two!
Expected output
2

Two chunks.

No final mark

Input
One sentence
Expected output
1

Final remainder.

Abbreviation

Input
Dr. Ana arrived.
Expected output
May overcount

Period is treated as boundary.

Common mistakes

Calling it grammatical analysis

Only regex punctuation. Correction: Use language-aware NLP.

Comparing styles

Abbreviation usage changes result. Correction: Review samples.

Ignoring other scripts

Only .!? terminate. Correction: Use locale rules.

Best practices

  • Label result an estimate.
  • Test abbreviations and decimals.
  • Use one tokenizer for comparisons.

Related operations and differences

Add Prefix to Every Line

Choose Add Prefix to Every Line when you need to add the same prefix before every line.; use Sentence Counter specifically for count sentences.

Add Suffix to Every Line

Choose Add Suffix to Every Line when you need to add the same suffix after every line.; use Sentence Counter specifically for count sentences.

Capitalize Every Word

Choose Capitalize Every Word when you need to capitalize the first character of every word.; use Sentence Counter specifically for count sentences.

Extract Email Addresses

Choose Extract Email Addresses when you need to find unique email addresses in text.; use Sentence Counter specifically for count sentences.

Extract URLs

Choose Extract URLs when you need to find unique HTTP and HTTPS links in text.; use Sentence Counter specifically for count sentences.

Line Counter

Choose Line Counter when you need to count the number of text lines.; use Sentence Counter specifically for count sentences.

Limitations and privacy

  • ASCII .!? regex heuristic only; no abbreviations, decimals, quotations, ellipses, locale punctuation, NLP, confidence, or boundary list.

The text is analyzed locally in this browser and is not uploaded by the tool.

Frequently asked questions

Is final punctuation required?

No.

Does ?! count as two?

It is treated as one terminal run.

Are abbreviations recognized?

No.

Is this language-aware?

No.

References