Last active
February 3, 2021 23:11
-
-
Save rotaliator/72546489cf1497eb95c3b54ffebd79a0 to your computer and use it in GitHub Desktop.
Remove polish characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.string :as str]) | |
(defn remove-pl [s] | |
(str/escape s (zipmap "ŻÓŁĆĘŚĄŹŃżółćęśąźń" "ZOLCESAZNzolcesazn"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import '(java.text Normalizer)) | |
(defn unaccent [s] | |
(-> s | |
(java.text.Normalizer/normalize (java.text.Normalizer$Form/NFD)) | |
(.replaceAll "[^\\p{ASCII}]", ""))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment