blob: 9a404639f46488caa30b1d747613d3a5f9b670d6 [file]
// Length-preserving normalization keeps Lunr highlight positions bound to the
// original text. Russian spelling with е and ё shares one search token.
function normalizeRussianSearch(value) {
return normalizeSearchDelimiters(value.replace(/ё/g, 'е').replace(/Ё/g, 'Е'));
}
function normalizeSearchDelimiters(value) {
return value.replace(/[()\[\]{},"';`]/g, ' ');
}
module.exports = {normalizeRussianSearch, normalizeSearchDelimiters};