fix: strip punctuation in normalizeTitle so comma variants match (e.g. 'Mr. Lawrence' vs 'Mr, Lawrence')
This commit is contained in:
1 parent
9821334cc8
commit
09cec18b33
1 file changed
+3
@@ -82,6 +82,9 @@ function normalizeTitle(s) {
|
|||||||
.replace(/\s+-\s+([^-]+)$/, ' ($1)')
|
.replace(/\s+-\s+([^-]+)$/, ' ($1)')
|
||||||
// strip all remaining parens/brackets content for the base comparison
|
// strip all remaining parens/brackets content for the base comparison
|
||||||
.replace(/[\[((][^\]))]*[\]))]/g, '')
|
.replace(/[\[((][^\]))]*[\]))]/g, '')
|
||||||
|
// strip punctuation so "Mr. Lawrence" == "Mr Lawrence" and comma variants match
|
||||||
|
.replace(/[,.'!?]/g, '')
|
||||||
|
.replace(/\s+/g, ' ')
|
||||||
.trim();
|
.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user