diff --git a/helper/diffPlaces.js b/helper/diffPlaces.js index c9c7ea5ab..0a3c195b7 100644 --- a/helper/diffPlaces.js +++ b/helper/diffPlaces.js @@ -386,7 +386,7 @@ function layerDependentNormalization(names, layer) { * lowercase characters and remove diacritics and some punctuation */ function normalizeString(str){ - return removeAccents(unicode.normalize(str)).toLowerCase().split(/[ ,-]+/).join(' '); + return removeAccents(unicode.normalize(str)).toLowerCase().split(/[ ,-.]+/).join(' '); } module.exports.isDifferent = isDifferent; diff --git a/test/unit/helper/diffPlaces.js b/test/unit/helper/diffPlaces.js index 4e095440c..42bc673ec 100644 --- a/test/unit/helper/diffPlaces.js +++ b/test/unit/helper/diffPlaces.js @@ -737,6 +737,7 @@ module.exports.tests.normalizeString = function (test, common) { t.equal(normalizeString('foo, bar'), 'foo bar'); t.equal(normalizeString('foo-bar'), 'foo bar'); t.equal(normalizeString('foo , - , - bar'), 'foo bar'); + t.equal(normalizeString('St. Marks'), 'st marks'); t.end(); });