translitrs

Crates.iotranslitrs
lib.rstranslitrs
version0.2.2
sourcesrc
created_at2021-12-15 22:07:30.704822
updated_at2023-02-19 15:34:41.262982
descriptionTransliteration utility for Serbian language
homepage
repositoryhttps://github.com/filiparag/translitRS
max_upload_size
id498787
size60,941
Filip Parag (filiparag)

documentation

README

Crates.io Build status License

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
Commit count: 39

cargo fmt