generate_text_summary: Generate text summary statistics

View source: R/annotate_gui.R

generate_text_summaryR Documentation

Generate text summary statistics

Description

Calculates basic summary statistics for the annotated text, including word counts, character counts, annotation counts, and unique code counts.

Usage

generate_text_summary(text, annotations)

Arguments

text

Character string containing the text being analyzed

annotations

Data frame of annotations with columns:

  • start: numeric, starting position of annotation

  • end: numeric, ending position of annotation

  • code: character, code applied to the annotation

Value

A list containing summary statistics:

  • total_words: total number of words in the text

  • total_characters: total number of characters

  • total_sentences: number of sentences (approximated by punctuation)

  • total_paragraphs: number of paragraphs (non-empty lines)

  • total_annotations: number of annotations

  • unique_codes: number of unique codes used


textAnnotatoR documentation built on April 3, 2025, 7:35 p.m.