Module:sa-utilities/translit/testcases

Hello, you have come here looking for the meaning of the word Module:sa-utilities/translit/testcases. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:sa-utilities/translit/testcases, but we will also tell you about its etymology, its characteristics and you will know how to say Module:sa-utilities/translit/testcases in singular and plural. Everything you need to know about the word Module:sa-utilities/translit/testcases you have here. The definition of the word Module:sa-utilities/translit/testcases will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:sa-utilities/translit/testcases, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

All tests passed. (refresh)

TextExpectedActualDiffers at
test_Deva_conversion:
Passedसंस्कृतsaṃskṛta, saMskfta, संस्कृतsaṃskṛta, saMskfta, संस्कृत
Passedतन्त्रtantra, tantra, तन्त्रtantra, tantra, तन्त्र
Passedचन्द्रcandra, candra, चन्द्रcandra, candra, चन्द्र
Passedस्वतंत्रsvataṃtra, svataMtra, स्वतंत्रsvataṃtra, svataMtra, स्वतंत्र
Passedत्रैंशtraiṃśa, trEMSa, त्रैंशtraiṃśa, trEMSa, त्रैंश
Passedकार्त्स्न्यkārtsnya, kArtsnya, कार्त्स्न्यkārtsnya, kArtsnya, कार्त्स्न्य
Passedउक्त्वाuktvā, uktvA, उक्त्वाuktvā, uktvA, उक्त्वा
Passedऔपद्रष्ट्र्यaupadraṣṭrya, Opadrazwrya, औपद्रष्ट्र्यaupadraṣṭrya, Opadrazwrya, औपद्रष्ट्र्य
Passedमार्त्स्नmārtsna, mArtsna, मार्त्स्नmārtsna, mArtsna, मार्त्स्न
Passedनिकुञ्जिकाम्लाnikuñjikāmlā, nikuYjikAmlA, निकुञ्जिकाम्लाnikuñjikāmlā, nikuYjikAmlA, निकुञ्जिकाम्ला
Passedमहत्mahat, mahat, महत्mahat, mahat, महत्
TextExpectedActualDiffers at
test_IAST_conversion:
PassedsaṃskṛtásaMskfta/, संस्कृत, saṃskṛtásaMskfta/, संस्कृत, saṃskṛtá
Passedtántrata/ntra, तन्त्र, tántrata/ntra, तन्त्र, tántra
Passedcandrácandra/, चन्द्र, candrácandra/, चन्द्र, candrá
Passedsvátaṃtrasva/taMtra, स्वतंत्र, svátaṃtrasva/taMtra, स्वतंत्र, svátaṃtra
PassedtraiṃśatrEMSa, त्रैंश, traiṃśatrEMSa, त्रैंश, traiṃśa
PassedkārtsnyakArtsnya, कार्त्स्न्य, kārtsnyakArtsnya, कार्त्स्न्य, kārtsnya
PasseduktvāuktvA, उक्त्वा, uktvāuktvA, उक्त्वा, uktvā
PassedaúpadraṣṭryaO/padrazwrya, औपद्रष्ट्र्य, aúpadraṣṭryaO/padrazwrya, औपद्रष्ट्र्य, aúpadraṣṭrya
PassedáupadraṣṭryaO/padrazwrya, औपद्रष्ट्र्य, aúpadraṣṭryaO/padrazwrya, औपद्रष्ट्र्य, aúpadraṣṭrya
Passedmā́rtsnamA/rtsna, मार्त्स्न, mā́rtsnamA/rtsna, मार्त्स्न, mā́rtsna
PassednikuñjikāmlānikuYjikAmlA, निकुञ्जिकाम्ला, nikuñjikāmlānikuYjikAmlA, निकुञ्जिकाम्ला, nikuñjikāmlā
Passedmahátmaha/t, महत्, mahátmaha/t, महत्, mahát
Passedkanyā̀kanyA\, कन्या, kanyā̀kanyA\, कन्या, kanyā̀
PassedmūrdhánmUrDa/n, मूर्धन्, mūrdhánmUrDa/n, मूर्धन्, mūrdhán
Passedátharvana/Tarvan, अथर्वन्, átharvana/Tarvan, अथर्वन्, átharvan
PassedmūrkhámUrKa/, मूर्ख, mūrkhámUrKa/, मूर्ख, mūrkhá
TextExpectedActualDiffers at
test_detect_to_SLP:
PassedsaṃskṛtásaMskfta/saMskfta/
Passedtántrata/ntrata/ntra
Passedcandrácandra/candra/
Passedस्वतंत्रsvataMtrasvataMtra
PassedtraiṃśatrEMSatrEMSa
Passedकार्त्स्न्यkArtsnyakArtsnya
PasseduktvāuktvAuktvA
Passedऔपद्रष्ट्र्यOpadrazwryaOpadrazwrya
PassedáupadraṣṭryaO/padrazwryaO/padrazwrya
Passedmā́rtsnamA/rtsnamA/rtsna
Passedनिकुञ्जिकाम्लाnikuYjikAmlAnikuYjikAmlA
Passedमहत्mahatmahat

local tests = require('Module:UnitTests')
local m_links = require('Module:links')
local lang = require('Module:languages').getByCode('sa')
local sa_utils_translit = require('Module:sa-utilities/translit')
local Deva_to_IAST = require('Module:sa-utilities/translit/Deva-to-IAST')
local Deva_to_SLP = require('Module:sa-utilities/translit/Deva-to-SLP1')
local IAST_to_SLP = require('Module:sa-utilities/translit/IAST-to-SLP1')
local SLP_to_IAST = require('Module:sa-utilities/translit/SLP1-to-IAST')
local SLP_to_Deva = require('Module:sa-utilities/translit/SLP1-to-Deva')

local function link(term)
	return m_links.full_link { lang = lang, term = term, tr = '-' }
end

function tests:check_Deva_conversion(input, expected)
	input = input
	local slp = Deva_to_SLP.tr(input)
	table.insert(expected, input)
	self:equals(link(input),
		table.concat({ Deva_to_IAST.tr(input), slp, SLP_to_Deva.tr(slp) }, ', '),
		table.concat(expected, ', '))
end

function tests:test_Deva_conversion()
	local examples = {
		{ { 'संस्कृत' }, { 'saṃskṛta', 'saMskfta' } },
		{ { 'तन्त्र' }, { 'tantra', 'tantra' } },
		{ { 'चन्द्र' }, { 'candra', 'candra' } },
		{ { 'स्वतंत्र' }, { 'svataṃtra', 'svataMtra' } },
		{ { 'त्रैंश' }, { 'traiṃśa', 'trEMSa' } },
		{ { 'कार्त्स्न्य' }, { 'kārtsnya', 'kArtsnya' } },
		{ { 'उक्त्वा' }, { 'uktvā', 'uktvA' } },
		{ { 'औपद्रष्ट्र्य' }, { 'aupadraṣṭrya', 'Opadrazwrya' } },
		{ { 'मार्त्स्न' }, { 'mārtsna', 'mArtsna' } },
		{ { 'निकुञ्जिकाम्ला' }, { 'nikuñjikāmlā', 'nikuYjikAmlA' } },
		{ { 'महत्' }, { 'mahat', 'mahat' } },
	}
	self:iterate(examples, 'check_Deva_conversion')
end

function tests:check_IAST_conversion(input, expected)
	input = input
	local slp = IAST_to_SLP.tr(input)
	if #expected < 3 then table.insert(expected, input) end
	self:equals(input,
		table.concat({ slp, SLP_to_Deva.tr(slp), SLP_to_IAST.tr(slp) }, ', '),
		table.concat(expected, ', '))
end

function tests:test_IAST_conversion()
	local examples = {
		{ { 'saṃskṛtá' }, { 'saMskfta/', 'संस्कृत', } },
		{ { 'tántra' }, { 'ta/ntra', 'तन्त्र' } },
		{ { 'candrá' }, { 'candra/', 'चन्द्र' } },
		{ { 'svátaṃtra' }, { 'sva/taMtra', 'स्वतंत्र' } },
		{ { 'traiṃśa' }, { 'trEMSa', 'त्रैंश' } },
		{ { 'kārtsnya' }, { 'kArtsnya', 'कार्त्स्न्य' } },
		{ { 'uktvā' }, { 'uktvA', 'उक्त्वा' } },
		{ { 'aúpadraṣṭrya' }, { 'O/padrazwrya', 'औपद्रष्ट्र्य' } },
		{ { 'áupadraṣṭrya' }, { 'O/padrazwrya', 'औपद्रष्ट्र्य', 'aúpadraṣṭrya' } },
		{ { 'mā́rtsna' }, { 'mA/rtsna', 'मार्त्स्न' } },
		{ { 'nikuñjikāmlā' }, { 'nikuYjikAmlA', 'निकुञ्जिकाम्ला' } },
		{ { 'mahát' }, { 'maha/t', 'महत्' } },
		{ { 'kanyā̀' }, { 'kanyA\\', 'कन्या' } },
		{ { 'mūrdhán' }, { 'mUrDa/n', 'मूर्धन्' } },
		{ { 'átharvan' }, { 'a/Tarvan', 'अथर्वन्' } },
		{ { 'mūrkhá' }, { 'mUrKa/', 'मूर्ख' } },
	}
	self:iterate(examples, 'check_IAST_conversion')
end

function tests:check_detect_to_SLP(input, expected)
	input = input
	local slp = IAST_to_SLP.tr(input)
	self:equals(input,
		sa_utils_translit.detect_to_SLP(input),
		expected)
end

function tests:test_detect_to_SLP()
	local examples = {
		{ { 'saṃskṛtá' }, { 'saMskfta/' } },
		{ { 'tántra' }, { 'ta/ntra' } },
		{ { 'candrá' }, { 'candra/' } },
		{ { 'स्वतंत्र' }, { 'svataMtra' } },
		{ { 'traiṃśa' }, { 'trEMSa' } },
		{ { 'कार्त्स्न्य' }, { 'kArtsnya' } },
		{ { 'uktvā' }, { 'uktvA' } },
		{ { 'औपद्रष्ट्र्य' }, { 'Opadrazwrya' } },
		{ { 'áupadraṣṭrya' }, { 'O/padrazwrya' } },
		{ { 'mā́rtsna' }, { 'mA/rtsna' } },
		{ { 'निकुञ्जिकाम्ला' }, { 'nikuYjikAmlA' } },
		{ { 'महत्' }, { 'mahat' } },
	}
	self:iterate(examples, 'check_detect_to_SLP')
end

return tests