Merge values that only differ by cosmetic characters
This commit is contained in:
parent
e0bf259be3
commit
54ce646931
1 changed files with 6 additions and 1 deletions
|
@ -114,8 +114,13 @@ pub fn store_song(
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut canonicalize = |s: &String| {
|
let mut canonicalize = |s: &String| {
|
||||||
|
let mut cleaned = s.clone();
|
||||||
|
cleaned.retain(|c| match c {
|
||||||
|
' ' | '_' | '-' | '\'' => false,
|
||||||
|
_ => true,
|
||||||
|
});
|
||||||
minuscules
|
minuscules
|
||||||
.entry(s.trim().to_lowercase())
|
.entry(cleaned.to_lowercase())
|
||||||
.or_insert_with(|| strings.get_or_intern(s))
|
.or_insert_with(|| strings.get_or_intern(s))
|
||||||
.to_owned()
|
.to_owned()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue