Skip to contents

This function calculates various stylistic features and their similarity between two conversations.

Usage

stylistic_similarity(text1, text2)

Arguments

text1

A character string representing the first conversation

text2

A character string representing the second conversation

Value

A list containing stylistic features and similarity measures

Examples

text1 <- "The quick brown fox jumps over the lazy dog. It's a sunny day."
text2 <- "A lazy cat sleeps on the warm windowsill. Birds chirp outside."
stylistic_similarity(text1, text2)
#> $text1_features
#>                 ttr avg_sentence_length            fk_grade 
#>           1.0000000           6.5000000           0.5603846 
#> 
#> $text2_features
#>                 ttr avg_sentence_length            fk_grade 
#>            1.000000            5.500000            4.791364 
#> 
#> $feature_differences
#>                 ttr avg_sentence_length            fk_grade 
#>            0.000000            1.000000            4.230979 
#> 
#> $overall_similarity
#> [1] 0.6543704
#> 
#> $cosine_similarity
#> [1] 0.5680224
#>