powered by
Compare Text Similarity Across Lists
same_text( ..., method = c("osa", "lv", "dl", "hamming", "lcs", "qgram", "cosine", "jaccard", "jw", "soundex"), q = 1, p = NULL, bt = 0, weight = c(d = 1, i = 1, s = 1, t = 1), digits = 3 )
An S3 class object of type "similar_text" containing:
scores: Numeric similarity scores by method and comparison
summary: Summary statistics by method and comparison
methods: Methods used for comparison
list_names: Names of compared lists
Lists of character strings to compare
Character vector of similarity methods from stringdist. Choose from: "osa", "lv", "dl", "hamming", "lcs", "qgram", "cosine", "jaccard", "jw", "soundex" (default: all)
stringdist
Size of q-gram for q-gram based methods (default: 1)
Winkler scaling factor for "jw" method (default: 0.1)
Booth matching threshold
Vector of weights for operations: deletion (d), insertion (i), substitution (s), transposition (t)
Number of digits to round results (default: 3)
list1 <- list("hello", "world") list2 <- list("helo", "word") result <- same_text(list1, list2)
Run the code above in your browser using DataLab