Skip to content

Instantly share code, notes, and snippets.

@sergiandreplace
Created November 17, 2021 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergiandreplace/d61fe49ffadc55161a0e6e1ea7debd47 to your computer and use it in GitHub Desktop.
Save sergiandreplace/d61fe49ffadc55161a0e6e1ea7debd47 to your computer and use it in GitHub Desktop.
Remove accents
private val accentRegex = Regex("\\p{InCombiningDiacriticalMarks}+")
Normalizer.normalize("camión", Normalizer.Form.NFD)
.replace(accentRegex, "")
.toLowerCase(Locale.getDefault())
.split(" ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment