2021年3月30日星期二

Similarity between character vectors (order-sensitive)

Suppose that I have the following three character vectors:

A = c("apple", "orange", "banana")  B = c("apple", "banana", "orange")  C = c("apple", "kiwi", "banana", "orange")  

What would be the best way to calculate the distance between A, B, and C? There should be some distance between A and B because the fruits are in different order. There should also be some distance between B and C because C has an item that B does not. The distance between A and C should be greater than the distance between A and B or that between B and C.

https://stackoverflow.com/questions/66881498/similarity-between-character-vectors-order-sensitive March 31, 2021 at 12:05PM

没有评论:

发表评论