translitRS is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install translitrs
It will make the translitrs command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall translitrs uninstalls.
Adding translitrs library as a dependency
Run this command in a terminal, in your project's directory:
cargo add translitrs
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
translitrs = "0.2.2"
The translitrs library will be automatically available globally.
Read the translitrs library documentation .
Back to the crate overview .
Readme
translitRS — Transliterator for Serbian Language
TranslitRS is a command-line utility for transliteration between Cyrillic and Latin scripts of the Serbian language. It can work on plain text files directly, or as a filter for Pandoc document processor (Markdown , HTML , LaTeX , Microsoft Word ...).
Usage
Arguments
- i, - - input < path>
Read input from file
Default: standard input
- o, - - output < path>
Write output to file
Default: standard output
- f, - - from < charset>
Convert from character set
Default: latin
- t, - - into < charset>
Convert to character set
Default: cyrillic
- d, - - skip- digraph
Do not check for digraph exceptions
- u, - - force- foreign
Process words with foreign and mixed characters
- l, - - force- links
Process hyperlinks, email addresses and units
- p, - - pandoc- filter
Run in Pandoc JSON pipe filter mode
- v, - - version
Show version and quit
- h, - - help
Show usage help and quit
Character sets
Listed below are available character sets and their shorthand codes:
Serbian Latin
latin, lat, l
Serbian Latin (Unicode)
latin8, lat8, l8
Serbian Cyrillic
cyrillic, cyr, c
Pandoc filter mode
When running as a Pandoc filter, the arguments listed above can't be passed directly. Instead, use the following arguments variables:
CHARS_FROM = < charset>
Convert from character set
CHARS_INTO = < charset>
Convert to character set
SKIP_DIGRAPH = 1
Do not check for digraph exceptions
FORCE_FOREIGN = 1
Process words with foreign and mixed characters
FORCE_LINKS = 1
Process hyperlinks, email addresses and units
Examples
# Transliterate plaintext file from Latin (Unicode) to Cyrillic
translitrs -f lat8 -t cyr -i source.txt -o destination.txt
# Transliterate Microsoft Word document from Cyrillic to Latin
CHARS_FROM=c CHARS_INTO=l pandoc essay.docx --filter translitrs -o essay.docx