Calculates metrics related to coding density in the text, including overall density and identification of densely coded regions.
analyze_coding_density(annotations)List containing:
overall_density: Numeric value representing proportion of text covered by codes
dense_regions: List of vectors, each containing start and end positions of identified dense coding regions
Data frame containing annotations with columns:
start: numeric, starting position
end: numeric, ending position
code: character, code identifier
Density is calculated as the ratio of coded text to total text length. Dense regions are identified where consecutive annotations are close together (within 20 characters by default).