cevado

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. :smiley:

First Post!

tallakt

tallakt

Hi. If youre interested you could have a look at codepagex… I wonder it it already does the same thing.

Most Liked

cevado

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.

Where Next?

Popular in Announcing Top

Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_orde...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54092 488
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
benlime
LiveMotion enables high performance animations declared on the server and run on the client. As a follow up to my previous thread A libr...
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 14585 119
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54996 245
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40082 209
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42576 114
New

We're in Beta

About us Mission Statement