lix_ton: LIX for Talk of Norway

Description Usage Arguments Details Value See Also Examples

Description

A function for calculating the LIX readability score for the Talk of Norway corpus

Usage

1
lix_ton(ids, ton_path = "../talk-of-norway/", cores = 1)

Arguments

ids

Character with ToN ids for the speeches to calculate LIX from

ton_path

Character specifying the relative path to the talk-of-norway repository folder

cores

Integer specifying number of processor cores to run the function on. Requires the parallel-package

Details

This is a function that uses the annotated part of the Talk of Norway corpus for computing LIX readability scores. It is a special wrapper for the more general lix function.

Value

A tibble with id, number of words, number of long words, number of sentences, and lix scores.

See Also

lix

Examples

1
2
3
4
5
6
7
8
data("tonDemo")
# Computing LIX for whole data
all <- lix_by_id(tonDemo$id, ton_path = "../talk-of-norway/", cores = detectCores()-2)
summary(all$lix)

# Computing LIX for Labor Party (A)
ap <- lix_by_id(tonDemo$id[which(tonDemo$party_id == "A")], ton_path = "../talk-of-norway/", cores = detectCores()-2)
summary(ap$lix)

martigso/tonR documentation built on May 21, 2019, 12:38 p.m.