normalize_text(string)
Normalizes a given <string> by converting it to lowercase, applying transliteration, and removing special symbols.
CREATE OR REPLACE FUNCTION `justfunctions.eu.normalize_text`(`string` string)
RETURNS string AS (TRIM(
justfunctions.eu.remove_extra_whitespaces(
justfunctions.eu.transliterate_anyascii(
justfunctions.eu.clean_special_symbols(
LOWER(
string
)
)
)
)
))
OPTIONS ( description = '''Normalizes a given <string> by converting it to lowercase, applying transliteration, and removing special symbols.''')
Example
SELECT `justfunctions.eu.normalize_text`("🎉 Welcome to Athens in 2023! Καλώς ήρθες!")
welcome to athens in 2023