Module:mr-translit/testcases

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

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

8 of 73 tests failed. (refresh)

TextExpectedActualDiffers atComments
test_translit_marathi:
Passedदगडdagaḍdagaḍweird schwa dropping in first syllable of words beginning with d (should be impossible!)
Passedदहशतdahśatdahśat
Passedदहशतdahśatdahśat
Passedदऱ्याdaryādaryā
Passedदहाdahādahā
Passedदहीdahīdahī
Passedदचकणेdacakṇedacakṇe
Passedखुद्दkhuddakhuddageminates/clusters finally force a schwa
Passedशुद्धśuddhaśuddha
Passedघट्टghaṭṭaghaṭṭa
Passedभिन्नbhinnabhinna
Passedमार्गmārgamārga
Passedकर्मkarmakarma
Passedशब्दśabdaśabda
Passedपत्रpatrapatra
Passedवृक्षvŕkṣavŕkṣa
Passedमहाराष्ट्रmahārāṣṭramahārāṣṭra
Passedभारतbhāratbhārat
Passedमराठीmarāṭhīmarāṭhī
Passedहृदयhŕdayhŕday
Passedगंगाgaṅgāgaṅgāanusvara before ग' is its homorganic nasal ('ṅ')
Passedलंडlaṇḍalaṇḍa
Passedकंबलkambalkambal
Passedरक्तraktarakta
Passedकाव्यkāvyakāvya
Passedमंदmandamanda
Failedउंच़unċauñċa2phonological ċ
Passedकृपाkŕpākŕpā‘ऋ’ is ‘ŕ’
Passedज्ञानjñānjñān
Passedऱ्हासrhāsrhās
Passedदऱ्याdaryādaryā
Passedदर्याdaryādaryā
Passedकैरीkairīkairī
Passedहौसhaushaus
Passedसंरक्षणsaurakṣaṇsaurakṣaṇ
Passedसंशयsauśaysauśay
Passedदंष्ट्रdauṣṭradauṣṭra
Failedहंसhaushausa5
Passedसंयोगsaiyogsaiyog
Passedसंलग्नsallagnasallagna
Passedसंवादsauvādsauvād
Passedसिंहsiuhasiuha
Passedसंहारsauhārsauhār
Passedसंज्ञाsañjñāsañjñā
Passedमाझंmājhamājha
Passedबॅटbĕṭbĕṭ
Failedबँकbĕṅkbĕṅka5
Failedॲपĕpĕpa3
Passedऍपĕpĕp
Passedकॉटkŏṭkŏṭ
Failedहाँग काँगhŏṅg kŏṅghŏṅga kŏṅga5
Passedऑस्ट्रेलियाŏsṭreliyāŏsṭreliyā
Failedच्याcyā2
Failedतुझ्याtujhātujhyā5
Passedच़ारċārċār
Passedचारcārcār
Passedकाच़ाkāċākāċā
Passedकाचाkācākācā
Passedच़राच़रċarāċarċarāċar
Passedचराचरcarācarcarācar
Passedज़पj̈apj̈ap
Passedजपjapjap
Passedमोज़णेmoj̈ṇemoj̈ṇe
Passedलाज़lāj̈lāj̈
Passedझ़कझ़कj̈hakj̈hakj̈hakj̈hak
Passedझकझकjhakjhakjhakjhak
Passedझ़ापडj̈hāpaḍj̈hāpaḍ
Passedझापडjhāpaḍjhāpaḍ
Passedझीज़jhīj̈jhīj̈
Passedचीज़cīj̈cīj̈
Failedअंगaṅgaṅga4
Passedअंगेaṅgeaṅge
Passedअंगंaṅgaaṅga

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

--TO DO
function tests:do_test_translit(deva, roman, comment)
	self:equals(
		'<span class="Deva" lang="mr">[[' .. deva .. '#Marathi|' .. deva .. ']]</span>',
		mr_translit.tr(deva, 'mr', 'Deva'),
		roman,
		{ comment = comment })
end

function tests:test_translit_marathi()
	local examples = {
	--Weird schwa dropping (need to fix!)
		{ 'दगड', 'dagaḍ', 'weird schwa dropping in first syllable of words beginning with d (should be impossible!)'}, 
		{ 'दहशत', 'dahśat'},  
		{ 'दहशत', 'dahśat'}, 
		{ 'दऱ्या', 'daryā' }, --‘दऱ्या’ is the plural of ‘दरी’
		{ 'दहा', 'dahā'}, 
		{ 'दही', 'dahī'}, 
		{ 'दचकणे', 'dacakṇe'}, 
	--Final clusters/geminates (need to fix!)
		{ 'खुद्द', 'khudda', 'geminates/clusters finally force a schwa'}, 
		{ 'शुद्ध', 'śuddha' }, 
		{ 'घट्ट', 'ghaṭṭa' }, 
		{ 'भिन्न', 'bhinna' }, 
		{ 'मार्ग', 'mārga' }, 
		{ 'कर्म', 'karma' }, 
		{ 'शब्द', 'śabda' }, 
		{ 'पत्र', 'patra' }, 
		{ 'वृक्ष', 'vŕkṣa' }, 
		{ 'महाराष्ट्र', 'mahārāṣṭra' }, 


	--Fundamental tests
		{ 'भारत', 'bhārat' }, 
		{ 'मराठी', 'marāṭhī' }, 
		{ 'हृदय', 'hŕday' }, 
	
	--Homorganic nasal assimilation 
		{ 'गंगा', 'gaṅgā', "anusvara before ग' is its homorganic nasal ('ṅ')" },
		{ 'लंड', 'laṇḍa' }, --anusvara before 'ड' is its homorganic nasal ('ṇ') 
		{ 'कंबल', 'kambal' }, --anusvara before 'ब' is its homorganic nasal ('m')
	
	--The following two categories could be problematic since they could interfere with cases without schwa deletion
	--such as English borrowings (ऑगस्ट)
	--Word-final consonant clusters with no schwa deletion
		{ 'रक्त', 'rakta' }, 
		{ 'काव्य', 'kāvya' }, --य-final is a subcase
	
	--Word-final nasal assimilation consonant clusters with no schwa deletion (where nasal is न)
		{ 'मंद', 'manda' }, --Sanskrit borrowing
		{ 'उंच़', 'unċa', 'phonological ċ'}, 
	
	--Tests individual letters
		{ 'कृपा', 'kŕpā', [=[‘ऋ’ is ‘ŕ’]=] },
		{ 'ज्ञान', 'jñān' }, --‘ज्ञ’ is ‘jña’ (even word initially such as Jñaneshwar)
	
	--Eyelash र
		{ 'ऱ्हास', 'rhās' }, 
		{ 'दऱ्या', 'daryā' }, --‘दऱ्या’ is the plural of ‘दरी’
		{ 'दर्या', 'daryā' }, 
	
	--Ensures औ and ऐ remain diphthongs
		{ 'कैरी', 'kairī' }, --‘ऐ’ is a diphthong
		{ 'हौस', 'haus' }, --‘औ’ is a diphthong
	
	--Anusvāra before र, श, ष, स: Provincial Class
		{ 'संरक्षण', 'saurakṣaṇ' }, --Anusvāra transliterated before र is ‘u’
		{ 'संशय', 'sauśay' }, 
		{ 'दंष्ट्र', 'dauṣṭra' }, --Word-final ‘a’
		{ 'हंस', 'haus' }, 
	
	--Anusvāra before य, ल, व: Classical Class
		{ 'संयोग', 'saiyog' }, --Anusvāra transliterated before य is ‘i’
		{ 'संलग्न', 'sallagna' }, --Anusvāra transliterated before ल is ‘u’ + Word-final ‘a’
		{ 'संवाद', 'sauvād' }, --Anusvāra is transliterated before व is ‘u’
	
	--Anusvāra: Other
		{ 'सिंह', 'siuha' }, --Anusvāra before ‘ह’ and after ‘इ’ + Word-final ‘a’
		{ 'संहार', 'sauhār' }, --Anusvāra before ‘ह’
		{ 'संज्ञा', 'sañjñā' }, --Anusvāra before ‘ज्ञ’
		{ 'माझं', 'mājha' }, --Anusvara to stop schwa dropping
	
	--English borrowings
		{ 'बॅट', 'bĕṭ' }, --‘ ॅ‘ is IPA /æ/ (बॅट = bat)
		{ 'बँक', 'bĕṅk' }, -- ‘ँ’ = ‘ॅ’ + ‘ं’, chandrabindu is never used as in Hindi
	                                      --Rurally ‘ॅ’ is ‘yā’, so बँक becomes ‘byāṅk’
		{ 'ॲप', 'ĕp' }, --Independent form of ‘ ॅ‘ (ॲप = app)
		{ 'ऍप', 'ĕp' }, --Another independent form of ‘ ॅ‘ (ऍप = app)
		{ 'कॉट', 'kŏṭ' }, --‘ॉ‘ is IPA /ɔ/ (कॉट = cot), RP ‘ɒ’ and ‘ɔ’ are both represented with ‘ॉ‘
	                                      --Rurally ‘ॉ‘ is ‘ā’, so डॉकटर becomes ‘ḍākṭar’
		{ 'हाँग काँग', 'hŏṅg kŏṅg' }, --‘ॉ’ = ‘ॉ’ + ‘ं (हाँग काँग = Hong Kong)
		{ 'ऑस्ट्रेलिया', 'ŏsṭreliyā' }, --Independent form of ‘ ॉ‘ (ऑस्ट्रेलिया = Australia)
	    
	--The remaining tests concern: c and ċ, j and j̈, jh and j̈h
	--य denotes palatalisation and has no independent realisation (Perhaps this should be in Mod:mr-IPA instead)
		{ 'च्या', 'cā' }, --‘ċ’ palatalised to ‘c’ in genitive oblique
		{ 'तुझ्या', 'tujhā' }, --‘j̈h’ palatalised to ‘jh’ in genitive oblique
	
	--च word-initial minimal pair
		{ 'च़ार', 'ċār' }, --Word-initial voiceless alveolar affricate, ‘चार’ means ‘four’
		{ 'चार', 'cār' }, --Word-initial voiceless palato-alveolar affricate, ‘चार’ means ‘graze’ or ‘young green grass’
	
	--च word-medial minimal pair
		{ 'काच़ा', 'kāċā' }, --Word-medial voiceless alveolar affricate, ‘काचा’ is the plural form of ‘काच’ kāċ, which means ‘glass’
		{ 'काचा', 'kācā' }, --Word-medial voiceless palato-affricate, ‘काचा’ means ‘button-hole’ or ‘tuck’
	
	--च word-initial and word-medial minimal pair
		{ 'च़राच़र', 'ċarāċar' }, --Word-medial voiceless alveolar affricate, ‘चराचर’ is an onomatopoeia that means ‘tearing sound’ or ‘rapidly’
		{ 'चराचर', 'carācar' }, --Word-medial voiceless palato-affricate, ‘चराचर’ means ‘every created thing, animate or inanimate‘
	
	--ज word-initial minimal pair
		{ 'ज़प', 'j̈ap' }, --Word-initial voiced alveolar affricate, ‘जप’ is an imperative that means ‘be careful’
		{ 'जप', 'jap' }, --Word-initial voiced palato-affricate, ‘जप’ means ‘counting beads’
	
	--ज alveolar affricate word-medial
		{ 'मोज़णे', 'moj̈ṇe' }, --Word-medial voiced alveolar affricate
	
	--ज alveolar affricate word-final
		{ 'लाज़', 'lāj̈' }, --Word-final voiced alveolar affricate
		
	--झ word-initial and word-medial two minimal pairs
		{ 'झ़कझ़क', 'j̈hakj̈hak' }, --Word-initial and word-medial breathy-voiced alveolar affricate, means ‘bright light’
		{ 'झकझक', 'jhakjhak' }, --Word-initial and word-medial breathy-voiced palato-alveolar affricate, means ‘complaining’
		{ 'झ़ापड', 'j̈hāpaḍ' }, --Word-initial and word-medial breathy-voiced alveolar affricate, means ‘drowsiness’
		{ 'झापड', 'jhāpaḍ' }, --Word-initial and word-medial breathy-voiced palato-alveolar affricate, means ‘slap’
	
	--One alveolar affricate and one palato-alveolar affricate in a single word
		{ 'झीज़', 'jhīj̈' }, --‘झीज’ means ‘erosion’, see Wiktionary entry for ‘झिजणे’
		{ 'चीज़', 'cīj̈' }, --‘चीज’ means ‘thing’, see Wiktionary entry for ‘चीज़’
	
	--anusvar word final, e.g. as a neuter plural marker -> nasalisation of vowel
		{ 'अंग', 'aṅg'},
		{ 'अंगे', 'aṅge'},
		{ 'अंगं', 'aṅga'},
	}
	
	self:iterate(examples, 'do_test_translit')
end
 
return tests