Skip to contents

Calculates the score of the supplied text string based on the Gendered Language Dictionary created by Roberts and Utych (2019).

Usage

gen_score(text)

Arguments

text

(string): A string object

Value

list object with avg_score of the supplied text string, total_score of supplied text string, and data.frame of matches

Details

Takes the matched words and their occurrence in the supplied text, finds the score for those matched words in the dictionary, sums those scores up and then divides it by the total number of words in the dictionary.

Examples

text <- 'Hero. hero Heroine. heroine, Prison. Prisom.'
result <- genCountR::gen_score(text)
result$avg_score
#> [1] 3.407279
result$total_score
#> [1] 20.44367
result$df
#>      word count   mean.a total_score
#> 1    hero     2 5.615385   11.230770
#> 2 heroine     2 1.800000    3.600000
#> 3  prison     1 5.612903    5.612903