Similar String
...the library for finding string similarities 🔎
With this library you can easily find rate of similarity of two strings or array of strings. Under the hood LCS (length finding variant) algorithm is used with O(n * m) time complexity and O(n) memory complexity.
Example
use ;
compare_similarity; // 0.75
find_best_similarity; // ("night", 0.8)
LCS Algorithm
You can also use the lcs_length that is used under the hood to compute length of longest common subsequence.
use lcs_length;
// The longest common subsequence in this case is "one"
lcs_length; // 3