export const normalizeSearchText = (text: string): string =>
  text
    .toLowerCase()
    .normalize("NFKD")
    .replace(/\p{M}+/gu, "")
    .replace(/[^\p{L}\p{N}\s]/gu, " ")
    .replace(/\s+/g, " ")
    .trim();

export const tokenizeSearchText = (text: string): string[] =>
  normalizeSearchText(text).split(" ").filter((token) => token.length > 0);