Module:hi-translit/testcases

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This is the unit-testing module for Module:hi-translit.

7 of 135 tests failed. (refresh)

TextExpectedActualDiffers atComments
test_translit_hindi:
Passedसँसsãssãs
Passedसंस्कारsanskārsanskār
Passedसंविधानsamvidhānsamvidhān
Passedउसाँसusā̃susā̃s
Passedमैंनेma͠inema͠ine
Passedऊँचाईū̃cāīū̃cāīlong vowel + nasalizer + unvoiced = nasalization
Failedऊंचाईū̃cāīūñcāī2long vowel + nasalizer + unvoiced = nasalization
Passedसाँपsā̃psā̃plong vowel + nasalizer + unvoiced = nasalization
Passedसूँघनाsūṅghnāsūṅghnālong vowel + nasalizer + voiced = nasal epenthesis
Passedसूंघनाsūṅghnāsūṅghnālong vowel + nasalizer + voiced = nasal epenthesis
Passedशंकाśaṅkāśaṅkāshort vowel + nasalizer = nasal epenthesis
Passedअशांतaśāntaśāntlong vowel + nasalizer + t = nasal epenthesis
Passedसर्वsarvsarvallowed final geminate
Passedअन्नannannallowed final geminate
Passedभिन्नbhinnbhinnallowed final geminate
Passedबांहbā̃hbā̃hnasalized long vowel before aspirate
Passedबाँहbā̃hbā̃hnasalized long vowel before aspire
Passedसाँझsāñjhsāñjhnasalized long vowel before palatal
Passedबाँटनाbā̃ṭnābā̃ṭnānasalized long vowel before retroflex (uncertain if nasal consonant is present or not)
Passedचाँपनाcā̃pnācā̃pnānasalized long vowel before retroflex (uncertain)
Passedप्रमेयprameyprameyfinal glide has no schwa
Passedउपप्रमेयupaprameyupaprameyfinal glide has no schwa
Passedचायवालाcāyvālācāyvālāglide after long vowel has no schwa
Passedडायनासोरḍāynāsorḍāynāsorglide after long vowel has no schwa
Passedसाँवलाsā̃vlāsā̃vlāglide after long vowel has no schwa
Passedकोयलाkoylākoylāglide after long vowel has no schwa
Failedज़िंदगीzindagīzindgī5
Passedधड़कनेdhaṛaknedhaṛakne
Passedलपटlapaṭlapaṭ
Passedलपटेंlapṭẽlapṭẽ
Passedउपयोगupyogupyog
Failedआलप्पुष़ाālappuḻāālappuẓā7
Passedकपड़ाkapṛākapṛā
Passedनज़दीकnazdīknazdīk
Passedजुड़वाँjuṛvā̃juṛvā̃
Passedकॉफ़ीkŏfīkŏfī
Passedफ़िल्मfilmfilm
Passedफ़ावड़ाfāvṛāfāvṛā
Passedकरनाkarnākarnā
Passedकरनkarankaran
Passedवस्त्रvastravastra
Passedभस्मbhasmabhasma
Passedअस्पतालaspatālaspatāl
Passedउत्तमuttamuttam
Passedक़लमqalamqalam
Passedदेवनागरीdevnāgrīdevnāgrī
Passedनमकीनnamkīnnamkīn
Passedवेदvedved
Passedरामrāmrām
Passedरचनाracnāracnā
Passedअंग्रेज़aṅgrezaṅgrez
Passedअंगरेज़aṅgrezaṅgrez
Passedविमलाvimlāvimlā
Passedभारतीयbhārtīyabhārtīya
Passedसमझाsamjhāsamjhā
Passedसमझsamajhsamajh
Passedलपटेंlapṭẽlapṭẽ
Passedलपटlapaṭlapaṭ
Passedसुलोचनाsulocnāsulocnā
Passedभारतbhāratbhārat
Passedदूःखdūḥkhdūḥkh
Passedनहींnahī̃nahī̃
Passed..
Passedप्लीज़plīzplīz
Passedकृपयाkŕpyākŕpyā
Passedमानहानिmānhānimānhāni
Passedतिरस्कारtiraskārtiraskār
Passedप्रतिबिंबpratibimbpratibimb
Passedसुवर्णsuvarṇsuvarṇ
Passedसंपत्तिsampattisampatti
Passedप्रवेशमार्गpraveśmārgpraveśmārg
Passedअंतःस्रावantaḥsrāvantaḥsrāv
Passedबहिष्कारbahiṣkārbahiṣkār
Passedव्यवच्छेदvyavacchedvyavacched
Passedजलावतनीjalāvatnījalāvatnī
Passedस्वत्वहरणsvatvaharaṇsvatvaharaṇ
Passedजब्तीjabtījabtī
Passedनिस्सारणnissāraṇnissāraṇ
Passedमैथमैटिक्सmaithmaiṭiksmaithmaiṭiks
Passedपिक्चरpikcarpikcar
Passedसंगमरमरsaṅgmarmarsaṅgmarmar
Passedतलवारtalvārtalvār
Passedअलमारीalmārīalmārī
Passedउब्द्रशालाubdraśālāubdraśālā
Passedटमाटरṭamāṭarṭamāṭar
Passedपेपरमिंटpeparmiṇṭpeparmiṇṭ
Passedइंगलिशiṅgliśiṅgliś
Passedअन्तर्राष्ट्रीयantarrāṣṭrīyaantarrāṣṭrīya
Passedरेफ्रिजरेटरrephrijreṭarrephrijreṭar
Passedरेफरिजरेटरrephrijreṭarrephrijreṭar
Passedरेफ्रिज्रेटरrephrijreṭarrephrijreṭar
Passedरेफरिज्रेटरrephrijreṭarrephrijreṭar
Passedअधिकांशadhikāñśadhikāñś
Passedअज़रबैजानazarbaijānazarbaijān
Passedअज़र्बैजानazarbaijānazarbaijān
Passedअफ्रीकाaphrīkāaphrīkā
Passedअफरीकाaphrīkāaphrīkā
Passedअफगानिस्तानaphgānistānaphgānistān
Passedअफ्गानिस्तानaphgānistānaphgānistān
Passedअफगानिसतानaphgānistānaphgānistān
Passedअफ्गानिसतानaphgānistānaphgānistān
Passedस्फिंकटरsphiṅkṭarsphiṅkṭar
Passedमांडवीmāṇḍvīmāṇḍvī
Passedलंपसमlampsamlampsam
Failedमयरामmayarāmmayrām4
Passedमैय्यmaiyyamaiyya
Passedरंगद्रव्यraṅgadravyaraṅgadravya
Passedरंगदारraṅgdārraṅgdār
Passedउमंगभरumaṅgbharumaṅgbhar
Passedउमंगहीनumaṅghīnumaṅghīn
Passedतंगहालtaṅghāltaṅghāl
Passedतत्वमीमांसाtatvamīmānsātatvamīmānsā
Passedतनहाईtanhāītanhāī
Passedत्रिकोणमितिtrikoṇmititrikoṇmiti
Passedदिसम्बरdisambardisambar
Passedदिसंबरdisambardisambar
Passedदिसमबरdisambardisambar
Passedदिलचस्पdilcaspdilcasp
Passedदुरूपयोगdurūpyogdurūpyog
Passedपचहत्तरpachattarpachattar
Passedḍhaḍha
Passedकिंमतkimmatkimmat
Passedहैंha͠iha͠i
Passedडाउनलोडḍāunloḍḍāunloḍ
Passedइंद्रधनुषindradhanuṣindradhanuṣ
Passedआगमनāgmanāgman
Failedअनुमतिanumatianumti5
Passedसम्मतिsammatisammati
Passedसंमतिsammatisammati
Passedमंज़ूरmanzūrmanzūr
Failedभारतीयbhāratīybhārtīya5
Failedप्रदेशीयpradeśīypradeśīya9
Passedनाईंnāī̃nāī̃
Passedख़ुशबुओंxuśbuõxuśbuõ
Passedरहस्य क्याrahasya kyārahasya kyā

-- Unit tests for [[Module:hi-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local hi_translit = require('Module:hi-translit')

function tests:do_test_translit(deva, roman, comment)
	self:equals('<span class="Deva" lang="hi">[[' .. mw.ustring.gsub(deva, "%+", "") .. '#Hindi|' .. mw.ustring.gsub(deva, "%+", "") .. ']]</span>', hi_translit.tr(deva, 'hi', 'Deva'), roman, { comment = comment })
end

local examples = {
    { 'सँस', 'sãs' },
    { 'संस्कार', 'sanskār' },
    { 'संविधान', 'samvidhān' },
    { 'उसाँस', 'usā̃s' },    
    { 'मैंने', 'ma͠ine' },
    { 'ऊँचाई', "ū̃cāī", "long vowel + nasalizer + unvoiced = nasalization" },
    { 'ऊंचाई', "ū̃cāī", "long vowel + nasalizer + unvoiced = nasalization" },
    { 'साँप', "sā̃p", "long vowel + nasalizer + unvoiced = nasalization" },
    { 'सूँघना', "sūṅghnā", "long vowel + nasalizer + voiced = nasal epenthesis" },
    { 'सूंघना', "sūṅghnā", "long vowel + nasalizer + voiced = nasal epenthesis" },
    { 'शंका', "śaṅkā", "short vowel + nasalizer = nasal epenthesis" },
    { 'अशांत', "aśānt", "long vowel + nasalizer + t = nasal epenthesis" },
    { 'सर्व', "sarv", "allowed final geminate" },
    { 'अन्न', "ann", "allowed final geminate" },
    { 'भिन्न', 'bhinn', 'allowed final geminate' },
    { 'बांह', "bā̃h", "nasalized long vowel before aspirate" },
    { 'बाँह', "bā̃h", "nasalized long vowel before aspire" },
    { 'साँझ', "sāñjh", "nasalized long vowel before palatal" },
    { 'बाँटना', "bā̃ṭnā", "nasalized long vowel before retroflex (uncertain if nasal consonant is present or not)" },
	{ 'चाँपना', 'cā̃pnā', "nasalized long vowel before retroflex (uncertain)" },
    { 'प्रमेय', 'pramey', 'final glide has no schwa' },
    { 'उपप्रमेय', 'upapramey', 'final glide has no schwa' }, --IPA /ʊp(ə̯)pɾəme(j)/
    { 'चायवाला', "cāyvālā", 'glide after long vowel has no schwa' },
	{ 'डायनासोर', 'ḍāynāsor', 'glide after long vowel has no schwa' },
	{ 'साँवला', 'sā̃vlā', 'glide after long vowel has no schwa' },
	{ 'कोयला', 'koylā', 'glide after long vowel has no schwa' },
	{ 'ज़िंदगी', 'zindagī' },
    { 'धड़कने', 'dhaṛakne' },
    { 'लपट', 'lapaṭ' },
    { 'लपटें', 'lapṭẽ' },
    --{ 'जिस्म', 'jism' }, loanword
    --{ 'ख़त्म', 'xatm' }, loanword
    { 'उपयोग', 'upyog' },
	{ 'आलप्पुष़ा', 'ālappuḻā' },
	{ 'कपड़ा', 'kapṛā' },
	{ 'नज़दीक', 'nazdīk' },
	{ 'जुड़वाँ', 'juṛvā̃' },
	{ 'कॉफ़ी', 'kŏfī' },
	{ 'फ़िल्म', 'film' },
	{ 'फ़ावड़ा', 'fāvṛā' },
	{ 'करना', 'karnā' },
	{ 'करन', 'karan' },
	{ 'वस्त्र', 'vastra' },
	{ 'भस्म', 'bhasma' },
	{ 'अस्पताल', 'aspatāl' },
	{ 'उत्तम', 'uttam' },
	{ 'क़लम', 'qalam' },
	{ 'देवनागरी', 'devnāgrī' },
	{ 'नमकीन', 'namkīn' },
	{ 'वेद', 'ved' },
	{ 'राम', 'rām' },
	{ 'रचना', 'racnā' },
	{ 'अंग्रेज़', 'aṅgrez' },
	{ 'अंगरेज़', 'aṅgrez' },	
	{ 'विमला', 'vimlā' },
	{ 'भारतीय', 'bhārtīya' },
	{ 'समझा', 'samjhā' },
	{ 'समझ', 'samajh' },
	{ 'लपटें', 'lapṭẽ' },
	{ 'लपट', 'lapaṭ' },
	{ 'सुलोचना', 'sulocnā' },
	{ 'भारत', 'bhārat' },
	{ 'दूःख', 'dūḥkh' },
	{ 'नहीं', 'nahī̃' },
	{ '।', '.' },
	{ 'प्लीज़', 'plīz' },
	{ 'कृपया', 'kŕpyā' },	
	{ 'मानहानि', 'mānhāni' },
	{ 'तिरस्कार', 'tiraskār' },
	{ 'प्रतिबिंब', 'pratibimb' },
	{ 'सुवर्ण', 'suvarṇ' },
	{ 'संपत्ति', 'sampatti' },
	{ 'प्रवेशमार्ग', 'praveśmārg' },
	{ 'अंतःस्राव', 'antaḥsrāv' },
	{ 'बहिष्कार', 'bahiṣkār' },
	{ 'व्यवच्छेद', 'vyavacched' },
	{ 'जलावतनी', 'jalāvatnī' },
	{ 'स्वत्व+हरण', 'svatvaharaṇ' },
	{ 'जब्ती', 'jabtī' },
	{ 'निस्सारण', 'nissāraṇ' },
	{ 'मैथमैटिक्स', 'maithmaiṭiks' },
	{ 'पिक्चर', 'pikcar' },
	{ 'संगमरमर', 'saṅgmarmar' },
	{ 'तलवार', 'talvār' },
	{ 'अलमारी', 'almārī' },
	{ 'उब्द्रशाला', 'ubdraśālā' },
	{ 'टमाटर', 'ṭamāṭar' },
	{ 'पेपरमिंट', 'peparmiṇṭ' },
	{ 'इंगलिश', 'iṅgliś' },
	{ 'अन्तर्राष्ट्रीय', 'antarrāṣṭrīya' },
	{ 'रेफ्रिजरेटर', 'rephrijreṭar' },
	{ 'रेफरिजरेटर', 'rephrijreṭar' },
	{ 'रेफ्रिज्रेटर', 'rephrijreṭar' },
	{ 'रेफरिज्रेटर', 'rephrijreṭar' },
	{ 'अधिकांश', 'adhikāñś' },
	{ 'अज़रबैजान', 'azarbaijān' },
	{ 'अज़र्बैजान', 'azarbaijān' },
	{ 'अफ्रीका', 'aphrīkā' },
	{ 'अफरीका', 'aphrīkā' },
	{ 'अफगानिस्तान', 'aphgānistān' },
	{ 'अफ्गानिस्तान', 'aphgānistān' },
	{ 'अफगानिसतान', 'aphgānistān' },
	{ 'अफ्गानिसतान', 'aphgānistān' },
	{ 'स्फिंकटर', 'sphiṅkṭar' },
	{ 'मांडवी', 'māṇḍvī' },
	{ 'लंपसम', 'lampsam' },
	{ 'मयराम', 'mayarām' },
	{ 'मैय्य', 'maiyya' },
	{ 'रंगद्रव्य', 'raṅgadravya' },
	{ 'रंगदार', 'raṅgdār' },
	--{ 'रंग+पटल', 'raṅgpaṭal' }, --additional functionalities required
	--{ 'संग+ठन', 'saṅgṭhan' },
	{ 'उमंगभर', 'umaṅgbhar' },
	{ 'उमंगहीन', 'umaṅghīn' },
	{ 'तंगहाल', 'taṅghāl' },
	{ 'तत्वमीमांसा', 'tatvamīmānsā' },
	{ 'तनहाई', 'tanhāī' },
	{ 'त्रिकोणमिति', 'trikoṇmiti' },
	{ 'दिसम्बर', 'disambar' },
	{ 'दिसंबर', 'disambar' },
	{ 'दिसमबर', 'disambar' },
	{ 'दिलचस्प', 'dilcasp' },
	{ 'दुरूपयोग', 'durūpyog' },
	{ 'पचहत्तर', 'pachattar' },
	{ 'ढ', 'ḍha' },
	{ 'किंमत', 'kimmat' },
	{ 'हैं', 'ha͠i' },
	{ 'डाउनलोड', "ḍāunloḍ" },
	{ 'इंद्र+धनुष', "indradhanuṣ" },
	{ 'आगमन', "āgman" },
	{ 'अनुमति', "anumati" },
	{ 'सम्मति', "sammati" },
	{ 'संमति', "sammati" },
    { 'मंज़ूर', "manzūr" },
    { 'भारतीय', "bhāratīy" },
    { 'प्रदेशीय', "pradeśīy" },
    { 'नाईं', "nāī̃" },
    { 'ख़ुशबुओं', "xuśbuõ" },
    { "'''रहस्य''' क्या", "'''rahasya''' kyā" },
}

function tests:test_translit_hindi()
	self:iterate(examples, "do_test_translit")
end
 
return tests