CYRCONV is a funny faux cyrillic character mapper. By defaul it transliterates characters of a given input text to cyrillic (Lоок-Дlікё) counterparts, while remaining the readability of the text. Using .flex files CYRCON.FLEX can map any character set into a desired output set.
Compile the the program in the examples folder and move it to the destination folder
Note: Make sure you save the flex
files from the flex folder outside the project folder.
There is currently no installation routine and cyrconv does not look into /usr/local/etc for flex files by default.
Example:
bash
// compile a release version
$ cargo build --release --example cyrconv
$ strip target/release/examples/cyrconv
// copy into the user program folder
$ sudo cp target/release/examples/cycronv /usr/local/bin
// make it executable
$ sudo chmod 755 /usr/local/bin/cyrconv
// copy flex files
$ sudo mkdir /usr/local/etc/cyrconv
$ sudo cp flex /usr/local/etc/cyrconv/
The program allows you to pipe a string to pass it as a single argument or as multiple arguments. If you want to use the flex option you have to pass them them as the first argument.
There are several ways Cyrconv can be used zext as arguments, piping (|) a source or reading from a file.
Examples:
bash
$ cyrconv Hello my many Friends.
$ cyrconv flex {..}/nko.flex Hello my Friends. How are you?
$ cyrconv "Hello Friend!"
$ cyrconv flex {..}/greek.flex "Hello Friends. How are you?"
$ echo "Hello Friend!" | cyrconv
$ echo "Hello Friends!" | cyrconv flex {..}/1337-lite.flex
$ cyrconv < ../Documents/the_hunger_games.txt
$ cyrconv flex {..}/braille.flex < ../Documents/the_hunger_games.txt
If you want to map a string that contains ' or " you have to escape the character or surround the string with the other one, that's not in the string.
Examples:
bash
$ echo "What's up" | cyrconv
$ echo "That's pretty \"cheap\"." | cyrconv
$ echo '"cheap" is what this is!' | cyrconv
$ echo "If you want to map a string that contains \' or \" you have to escape the character \
or surround the string other one, that\'s not in the string." | cyrconv
Via stdin (|) you can pass multiline text as well.
Example:
bash
$ ls -la | cyrconv
$ printf "Hello World\nHow are you?" | cyrconv
$ less LICENSE.md | cyrconv
Maps a given input sentence into the default target character set.
The default mapping works without a .flex file.
cyrconv sentence
Example:
bash
$ cyrconv When the seagulls follow the trawler, it is because they think sardines will be thrown into the sea.
Шнеп тне ѕеаgцllѕ fоllош тне тгашlег, іт іѕ весацѕе тнеч тніпк ѕагdіпеѕ шіll ве тнгошп іпто тне ѕеа.
The flex option allows you to load a custom character mapping file.
cyrconv flex {flex_file} sentence
Example:
bash
$ cyrconv flex rot-13.flex When the seagulls follow the trawler, it is because they think sardines will be thrown into the
sea
Jura gur frnthyyf sbyybj gur genjyre, vg vf orpnhfr gurl guvax fneqvarf jvyy or guebja vagb gur frn
The flex file is a simple text file that consists of two lines.
The first line is a string of characters that matches expected input characters.
The second line is a string that consists of characters of the desired output character set.
Both lines must have the same character count.
Btw, the character calle СІЯСЦМҒLЁХ ' ˇ ' maps into the character called СДЯОП ' ^ '.
You can also combine different character sets. Keep in mind, that for each output there must be a flex file that provides the output as input.
Examples:
bash
$ cyrconv flex 1337-lite.flex Hello my friend. Nastrowje. | cyrconv
Н3ll0 мч fг13п). П4ѕтг0шј3.
ог
bash
$ cyrconv $(cyrconv flex 1337-lite.flex "Hello my friend. Nastrowje.")
Н3ll0 мч fг13п). П4ѕт3г0шј3.
Ѕёё fіlё "гцѕѕіап.соdё"
If you cannot see all characters in this section, you might have to install additional terminal fonts. See the Wiki for your linux distro for further information.
Wh3n th3 s34gulls f0ll0w th3 tr4wl3r, 1t 1s b3(4us3 th3y th1nk s4r)1n3s w1ll b3 thr0wn 1nt0 th3 s34.
Note: This is the correct transliteration from Latin to Braille.
⠺⠓⠑⠝⠀⠞⠓⠑⠀⠎⠑⠁⠛⠥⠇⠇⠎⠀⠋⠕⠇⠇⠕⠺⠀⠞⠓⠑⠀⠞⠗⠁⠺⠇⠑⠗,⠀⠊⠞⠀⠊⠎⠀⠃⠑⠉⠁⠥⠎⠑⠀⠞⠓⠑⠽⠀⠞⠓⠊⠝⠅⠀⠎⠁⠗⠙⠊⠝⠑⠎⠀⠺⠊⠇⠇⠀⠃⠑⠀⠞⠓⠗⠕⠺⠝⠀⠊⠝⠞⠕⠀⠞⠓⠑⠀⠎⠑⠁.
Шнёп тнё ѕёаgцllѕ fоllош тнё тгашlёг, іт іѕ вёсацѕё тнёч тніпк ѕагdіпёѕ шіll вё тнгошп іпто тнё ѕёа.
WႬeი ჯႬe Ⴝeaჳullჷ follow ჯႬe ჯrawler, iჯ iჷ ხeეauჷe ჯႬeႸ ჯႬiიk ჷarძiიeჷ will ხe ჯႬrowი iიჯo ჯႬe ჷea.
Ψhεη ͳhε ϟεαgυιιϟ ϝοιιοω ͳhε ͳͱαωιεͱ, iͳ iϟ βεϛαυϟε ͳhεγ ͳhiηκ ϟαͱδiηεϟ ωiιι βε ͳhͱοωη iηͳο ͳhε ϟεα.
Wߚen ߙߚe Seߡgߎlls fߋllߋW ߙߚe ߠrߡWler? ߊߙ ߊs ߕeߏߡߎse ߙߚeߌ ߙߚߊnk Sߡr߄ߊnes Wߊll ߕe ߙߚrߋWn ߊnߙߋ ߙߚe seߡ,
Jura gur frnthyyf sbyybj gur genjyre, vg vf orpnhfr gurl guvax fneqvarf jvyy or guebja vagb gur frn.
Wⴼⴺⵍ ⵜⴼⴺ SⴺⴷGⵡⵃⵃS FⵙⵃⵃⵙW ⵜⴼⴺ ⵜRⴷWⵃⴺR, ⵊⵜ ⵊS BⴺⵎⴷⵡSⴺ ⵜⴼⴺⵖ ⵜⴼⵊⵍK SⴷRDⵊⵍⴺS Wⵊⵃⵃ Bⴺ ⵜⴼRⵙWⵍ ⵊⵍⵜⵙ ⵜⴼⴺ Sⴺⴷ.
Zzzz zzz zzzzzzzz zzzzzz zzz zzzzzzz, zz zz zzzzzzz zzzz zzzzz zzzzzzzz zzzz zz zzzzzz zzzz zzz zzz.
From version 0.3.0 this repository contains the library and the program.