Skip to main content
100%

Query for long and short phrases in Shakespeare's plays

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

This visualization shows the distribution of long versus short phrases in Shakespeare’s plays, counting how many phrases exceed twenty characters. A bar-like layout compares the two categories, making the frequency difference immediately visible. The code uses XQuery 3.0 with the `fn:collection` and `tei:ab` functions to access and iterate over TEI-annotated text blocks, applying `fn:string-length` to classify each phrase. It groups results by length category using the `group by` clause, then dynamically constructs an element named `long-phrase` or `short-phrase` with the corresponding count, rendering the final output as XML.

AI-generated description

Similar vizzes