strsim-rs
strsim-rs copied to clipboard
Document Algorithms and Functions better
I am having a hard time understanding what all those functions of this library are used for and which one I should use.
It would be good to have a broad explanation of the algorithm, it's uses and maybe a link to some resources, that explains it in further detail. Maybe also list the advantages and disadvantages?
You could also include some real world examples
For example, how could I improve this simple search function with strsim
, to not only find exact matches, but also very similar matches;
fn search(list: Vec<&str>, value: &str) -> Option<&str> {
for x in &list {
if x == value {
return Some(x);
}
}
return None;
}
Maybe this could be useful https://medium.com/@appaloosastore/string-similarity-algorithms-compared-3f7b4d12f0ff
As a starting point for docs we can use the docs I have already written for rapidfuzz-rs here: https://docs.rs/rapidfuzz/latest/rapidfuzz/distance/index.html
The readme should probably guide people to either strsim
, rapidfuzz
or the reference implementation (once written) depending on the users requirements.