2018-04-27 13:06:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
test_word()
|
|
|
|
{
|
2018-05-13 17:15:26 +02:00
|
|
|
transliterated=$(echo -n "$1" | ./iast $3 --)
|
2018-04-27 13:06:21 +02:00
|
|
|
expected="$2"
|
|
|
|
|
|
|
|
if test "x$transliterated" = "x$expected"
|
|
|
|
then
|
|
|
|
echo "\033[32m$transliterated\033[0m = \033[32m$expected\033[0m"
|
|
|
|
else
|
|
|
|
echo "\033[31m$transliterated\033[0m != \033[31m$expected\033[0m"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-04-28 14:03:30 +02:00
|
|
|
echo "Transliteration to IAST"
|
2018-04-27 13:06:21 +02:00
|
|
|
test_word "संस्कृतम्" "saṃskṛtam"
|
|
|
|
test_word "आर्यावर्त" "āryāvarta"
|
|
|
|
test_word "तन्त्रशास्त्रम्" "tantraśāstram"
|
2018-04-28 13:33:50 +02:00
|
|
|
test_word "सांख्य" "sāṃkhya"
|
2018-04-27 13:06:21 +02:00
|
|
|
test_word "ऋग्वेद" "ṛgveda"
|
|
|
|
test_word "महाभारतम्" "mahābhāratam"
|
|
|
|
test_word "सरस्वती नदी" "sarasvatī nadī"
|
|
|
|
test_word "देवनागरी" "devanāgarī"
|
|
|
|
test_word "योगः" "yogaḥ"
|
|
|
|
test_word "भगवद्गीता" "bhagavadgītā"
|
2018-04-28 13:33:50 +02:00
|
|
|
test_word "सम्भोग" "sambhoga"
|
2018-04-28 14:03:30 +02:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Transliteration to czech"
|
|
|
|
test_word "तन्त्रशास्त्रम्" "tantrašástra" -c
|
|
|
|
test_word "सांख्य" "sánkhja" -c
|
|
|
|
test_word "महाभारतम्" "mahábhárata" -c
|
|
|
|
test_word "योगः" "jóga" -c
|
|
|
|
test_word "भगवद्गीता" "bhagavadgíta" -c
|