Proportion n gram overlap

ngram_proportion_same(a, b, n_grams, show = "none", meta = "none")

Arguments

a

character string of text

b

character string of text

n_grams

integer number of ngrams

Value

numeric proportion of ngram overlap

Examples

p1 <- "hello my name is someone someone" p2 <- "my name is someone else" ngram_proportion_same(p1,p2,2)
#> [1] 0.5