DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 963,503 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for New Release: Tate v1.0.0
Kerem Bozdas
Kerem Bozdas

Posted on

New Release: Tate v1.0.0

πŸ’Ž Just released a major update for tate! (v1.0.0) πŸ’Ž

Release highlights:
πŸ‘‰ Custom filter support
πŸ‘‰ Support for 11 new languages
πŸ‘‰ Improved command line tool

πŸ”— Check it out!


Tate ✍️

Tate converts accented characters and transliterates non-latin scripts to their closest ASCII equivalent.

Tate is a productivity tool, it behaves like a standard Unix application and can be chained with other Unix commands. It reads from standard input and writes to standard output. You can use it either as a commandline utility or a library.

Examples

Let's say you have a French sentence with a lot of weird characters and you want to convert it into ASCII in the most representative way. You can use:

echo 'Le cΕ“ur de la crΓ©miΓ©re' | tate  #=> Le coeur de la cremiere
Enter fullscreen mode Exit fullscreen mode

Or some Bulgarian text you can't read:

echo 'Π—Π΄Ρ€Π°Π²Π΅ΠΉ!' | tate --lang=bg  #=> Zdravey!
Enter fullscreen mode Exit fullscreen mode

Set language using lang option for custom filters, e.g. German:

echo 'Von großen Blâcken haut man große Stücke.' | tate --lang=de

Letters â, ü and ß will be transliterated based on German transliteration rules:

Von grossen Bloecken haut man grosse Stuecke.

Language specific punctuation will be converted to closest ASCII equivalent.

For example, in Catalan, notice how the quotes (cometes franceses) and the interpunct (punt volat) are transliterated:

Β«DΓ³na amor que serΓ s feliΓ§!Β». AixΓ², ilΒ·lΓΊs company geniΓΌt, ja Γ©s un lluΓ―t rΓ¨tol blavΓ­s d’onze kWh.
"Dona amor que seras felic!". Aixo, il-lus company geniut, ja es un lluit retol blavis d'onze kWh.
Enter fullscreen mode Exit fullscreen mode

Installation

Add this line to your application's Gemfile:

gem 'tate'
Enter fullscreen mode Exit fullscreen mode

And then execute:

$ bundle
Enter fullscreen mode Exit fullscreen mode

Or install it yourself as:

$ gem install tate
Enter fullscreen mode Exit fullscreen mode

Usage

Ruby Library

require 'tate'
Tate::transliterate('ZΙ™fΙ™r', language='az')  #=> Zefer
Enter fullscreen mode Exit fullscreen mode

Commandline Utility

Usage: tate [options]
-l, --lang=[LANGUAGE]            Set language for custom filters
-h, --help                       Show this message
-v, --version                    Show version
Enter fullscreen mode Exit fullscreen mode

Interactive Mode

If you call tate without providing any arguments, it will expect you to provide input using standard input (keyboard). After you are done typing you can use cmd + D to trigger EOL (End of Line) and the result will printed in the next line.

Standard Streams

You can pipe the output of another command into tate.

curl gov.bg/bg | tate --lang=bg > index.html
Enter fullscreen mode Exit fullscreen mode

Language Support

There are custom filters for:

Azeri, Bulgarian, Catalan, French, German, Hungarian, Polish, Romanian, Spanish, and Vietnamese.
Enter fullscreen mode Exit fullscreen mode

The following languages are known to work (w/o custom filters):

Croatian, Czech, Danish, Esperanto, Estonian, Finnish, Icelandic, Latvian, Lithuania, Norwegian, Portuguese, Scottish, Slovak, Slovenian, Swedish, Turkish, and Welsh.
Enter fullscreen mode Exit fullscreen mode

What's next?

Russian, Irish, Arabic, and Yoruba.
Enter fullscreen mode Exit fullscreen mode

Is it any good?

Yes.

Donations

You can donate me at Librepay. Thanks! β˜•οΈ

Trivia

tate is short for t ransliter ate.

Nobody has time to type transliterate in the terminal. πŸ€·β€β™‚οΈ


Since you made it this far.. πŸ€“

Don't forget to ⭐️ my repository if you like it!

Bug reports and pull requests are welcome! β™₯️

Happy Hacking,
Kerem

Top comments (0)

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›