Crates.io | str_sim |
lib.rs | str_sim |
version | 0.1.2 |
source | src |
created_at | 2020-11-10 07:31:45.215561 |
updated_at | 2020-11-23 08:50:00.763313 |
description | Calculate the similarity between strings. |
homepage | |
repository | |
max_upload_size | |
id | 310668 |
size | 6,623 |
rust
计算字符串之间的相似度
calculate the similarity between strings
currently contains the following algorithms : 【levenshtein、jaro、jaro_winkler】
[dependencies]
str_sim = "0.1.2"
use str_sim::{levenshtein_distance, sim_jaro_winkler, sim_jaro};
fn main() {
assert_eq!(levenshtein_distance("dontbeproud", "dontbepride"), 3);
assert_eq!(jaro::sim_jaro("dontbeproud", "dontbepride"), 0.8787878787878789);
assert_eq!(jaro_winkler::sim_jaro_winkler("dontbeproud", "dontbepride", 0.05), 0.9272727272727274);
}
另外,另一个用于分析账号之间相似度的项目正在开发中
In addition, another project for analyzing the similarity between accounts is under development
<https://github.com/DontBeProud/calculate_account_names_similarity_rs>
<https://gitee.com/DontBeProud/calculate_account_names_similarity_rs>