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 ofre.findall(r"\w+'\w+", text)matches — AFTER normalizing curly apostrophes to straight ones withtext.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