Skip to content

Instantly share code, notes, and snippets.

@Georgy5
Created April 2, 2024 07:25
Show Gist options
  • Save Georgy5/9e1306f4ae7cea61d1676e53cbe3d663 to your computer and use it in GitHub Desktop.
Save Georgy5/9e1306f4ae7cea61d1676e53cbe3d663 to your computer and use it in GitHub Desktop.
"Latinize" string normalization
def latinize(string)
string.unicode_normalize(:nfd).chars.select do |char|
char.match(/\p{Latin}|\s/)
end.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment