Skip to main content
100%

Produces word frequency list for speakers in Much Ado about Nothing.

✓ Published0🌍 Public
CCliffordAnderson
Last edited Dec 19, 2013
Created on Dec 19, 2013

This example uses XQuery 3.0 with the TEI namespace to generate a per-speaker word frequency list from Shakespeare’s *Much Ado about Nothing*. It processes the TEI-encoded XML document, iterating over distinct speakers and counting each word’s occurrences within their spoken lines, then outputs a sequence of `<word>` elements with the speaker, type, count, and weighted frequency. The query relies on `fn:distinct-values`, `fn:count`, and an `order by` clause to rank terms.

AI-generated description

Similar vizzes