Calculates multiple readability metrics for texts including Flesch Reading Ease, Flesch-Kincaid Grade Level, Gunning FOG index, and others. Optionally includes lexical diversity metrics and sentence statistics.
Usage
calculate_text_readability(
texts,
metrics = c("flesch", "flesch_kincaid", "gunning_fog"),
include_lexical_diversity = TRUE,
include_sentence_stats = TRUE,
dfm_for_lexdiv = NULL,
doc_names = NULL
)Arguments
- texts
Character vector of texts to analyze
- metrics
Character vector of readability metrics to calculate. Options: "flesch", "flesch_kincaid", "gunning_fog", "smog", "ari", "coleman_liau"
- include_lexical_diversity
Logical, include TTR and MTLD (default: TRUE)
- include_sentence_stats
Logical, include average sentence length (default: TRUE)
- dfm_for_lexdiv
Optional pre-computed DFM for lexical diversity calculation
- doc_names
Optional character vector of document names
See also
Other lexical:
calculate_dispersion_metrics(),
calculate_lexical_dispersion(),
calculate_log_odds_ratio(),
clear_lexdiv_cache(),
detect_multi_words(),
extract_keywords_keyness(),
extract_keywords_tfidf(),
extract_morphology(),
extract_named_entities(),
extract_noun_chunks(),
extract_pos_tags(),
extract_subjects_objects(),
find_similar_words(),
get_sentences(),
get_spacy_embeddings(),
get_spacy_model_info(),
get_word_similarity(),
init_spacy_nlp(),
lexical_analysis,
lexical_diversity_analysis(),
lexical_frequency_analysis(),
parse_morphology_string(),
plot_keyness_keywords(),
plot_keyword_comparison(),
plot_lexical_diversity_distribution(),
plot_morphology_feature(),
plot_readability_by_group(),
plot_readability_distribution(),
plot_tfidf_keywords(),
plot_top_readability_documents(),
render_displacy_dep(),
render_displacy_ent(),
spacy_extract_entities(),
spacy_has_vectors(),
spacy_initialized(),
spacy_parse_full(),
summarize_morphology()
