https://github.com/mrapacz/latinizer
A module providing logic for transcribing strings to latin and removal of diacritics in strings
https://github.com/mrapacz/latinizer
Last synced: 4 months ago
JSON representation
A module providing logic for transcribing strings to latin and removal of diacritics in strings
- Host: GitHub
- URL: https://github.com/mrapacz/latinizer
- Owner: mrapacz
- License: mit
- Created: 2017-11-17T23:58:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-24T12:06:48.000Z (over 8 years ago)
- Last Synced: 2026-02-15T20:52:44.924Z (4 months ago)
- Language: Elixir
- Homepage:
- Size: 27.3 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Latinizer
[](https://circleci.com/gh/mrapacz/latinizer/tree/master)
[](https://hex.pm/packages/latinizer/)
[](https://github.com/mrapacz/latinizer)
[](https://github.com/mrapacz/latinizer/blob/enhancement/readme-badges/LICENSE)
**A string-translating module responsible for getting rid of diacritical signs in strings**
## Installation
Available in [Hex](https://hex.pm/packages/latinizer/).
The package can be installed by adding `latinizer` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:latinizer, "~> 0.4.0"}]
end
```
## Usage
The lib allows one to transcribe and remove diacritics from strings containing characters used in most of the European languages (e.g. Polish, Russian, Swedish, French etc.) to string containing only latin letters. The most common usage is as follows:
```elixir
iex> Latinizer.latinize "Pchnij w tę łódź jeża lub ośm skrzyń fig."
"Pchnij w te lodz jeza lub osm skrzyn fig."
iex> Latinizer.latinize "Pchnij w tę łódź jeża lub ośm skrzyń fig.", only: ["ż", "ę"]
"Pchnij w te łódź jeza lub ośm skrzyń fig."
iex> Latinizer.latinize "В начале было Слово, и Слово было у Бога, и Слово было Бог."
"V nachale bylo Slovo, i Slovo bylo u Boga, i Slovo bylo Bog."
```
To find more examples and functions provided by the library, read [the docs](https://hexdocs.pm/latinizer).
## Contributing
Should you find missing character mappings or any other problems, feel free to create
issues in the repo for that, I'll be happy to help.