cevado
Unidecode implementation for Elixir
I just published unidecode package to hex:
https://github.com/fcevado/unidecode
Unidecode was initially a perl module to transliterate unicode characters to ascii, then it became a widespread library throughout several languages(python, java, ruby, c#, rust). Everyone that already integrated with old systems know that it’s necessary pain.
I published a implementation with a simple approach, that only includes latin code charts. My idea is to gradually add all charts. Right know I’m on documenting/testing step. Basically its a very small application(needs to be added to extra_applications) that expose a simple api, Unidecode.unidecode/1 and Unidecode.decode/1, both do the same thing, receives a string and transliterate the chars that it knows. Why 2 functions that do the same? Perl and Python implementations exposes only unidecode/1 that supposedly is imported everywhere you need it(since rarely you will have a conflit with a function called unidecode). I added decode/1 just in case you dont want to import the function and want to call it refering to the module.
I want to ask that anyone that needs something like that, please take a look at the library, send suggestions on changes to improve it, I published on 0.0.1 and very raw material like that, to see what fits better the community need. ![]()
Most Liked
cevado
Hi @tallakt, actually it doesn’t. Convert encodings is a different task from transliteration. Let’s say I have the greek word Λάμ(β)δα, just converting encodings I would loose this data, transliteration looks for a way to represent this data meaningfully. So taking Λάμ(β)δα as an example a transliterated version should be Lam(b)da. In some sort of way it’s kinda a romanization, but avoiding special caracters in the latin script. So the character ç would be just c.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









