promptdojo_

The voice fingerprint — a client's voice, measured from their own copy — step 7 of 8

Two samples land on your desk: real Windrow product copy pulled straight from the live CMS — typographic apostrophes (’) and all — and the press blast a previous agency drafted before the client fired them. Write fingerprint(text) that returns a dict with:

  • avg_words: words (whitespace split) divided by sentences, rounded to 1 decimal. Sentences = non-empty pieces after splitting on [.!?]+ (strip whitespace, drop empties).
  • exclaims: count of "!" characters.
  • contractions: count of re.findall(r"\w+'\w+", text) matches — AFTER normalizing curly apostrophes to straight ones with text.replace("’", "'"). Skip that line and the CMS copy reports zero contractions, which is a lie.

Expected output:

product-page: avg=5.7 exclaims=0 contractions=2
press-blast: avg=6.0 exclaims=4 contractions=0

full-screen editor opens — close anytime to keep reading.