Jump to content

Module:fa-cls-translit/documentation

Wiktionary වෙතින්

This module will transliterate Classical Persian text. The module should preferably not be called directly from templates or other modules. To use it from a template, use {{xlit}}. Within a module, use Module:languages#Language:transliterate.

For testcases, see Module:fa-cls-translit/testcases.

Functions

tr(text, lang, sc)
Transliterates a given piece of text written in the script specified by the code sc, and language specified by the code lang.
When the transliteration fails, returns nil.

This template transliterates Persian based how it would be read in Classical Persian. So keep in mind that this template should be used with classical-style vocalization, a guide explaining Classical vocalization can be seen here.

This template may also be used for most eastern dialects of Persian, which do not have any standard vocalizations, but commonly use the classical vocalization. However it will show vowel length for all dialects, even for dialects that no longer possess vowel length such as Hazaragi.

This template should not be used for Modern Iranian Persian, for which Module:fa-ira-translit should be used instead. However, classical Iranian texts should use this module (all Iranian texts before the 13 or 16th century).

  1. In this module, when two semi-vowel characters are near each other the first one becomes the consonant and the second character becomes the vowel. To prevent this, pairing any vowel diacritic to the secondary semivowel will turn it into a consonant.
    • Example: خْویش (xwēš) vs خویْش (xōyš)
  2. Alif must be proceeded by a zabar, to prevent false positives.
  3. The Sukoon/Jazm diacritic is required for consonant clusters or else the module will return nil.
  4. This module can transliterate izāfa diacritics by finding when the diacritic zēr is followed by a space instead of a he.
  5. supports assimilations for Arabic al-
  6. ma'rūf vowels (āīū) should be denoted with their corresponding short vowel as they would in Arabic; majhūl vowels (ēō) should not have any proceeding vowel diacritics.
  7. "xwV" can be distinguished from "xV" (silent waaw) with a sukoon, without a sukoon the waaw will be silent.
    • Example: خْویش (xwēš) vs خویش (xēš)

Test:

گُرُسْنَه چِه کَارِی کُنَد چِهِل نَر، کِه دَهْ لَک بَرْآیَد بَر او بی‌خَبَر، کِه پَیْمَان‌شِکَسْت بی‌دَرَنْگ آمَدَنْد، مِیَانِ تیغ و تِیر و تُفَنْگ آمَدَنْد

Result:

gurusna či kārī kunad čihil nar, ki dah lak bar'āyad bar ō bē-xabar, ki paymān-šikast bē-darang āmadand, miyān-i tēğ u tīr u tufang āmadand

Expected:

gurusna či kārī kunad čihil nar, ki dah lak bar-āyad bar ō bē-xabar, ki paymān-šikast bē-darang āmadand, miyān-i tēğ u tīr u tufang āmadand


2 of 74 tests failed. (refresh)

TextExpectedActualDiffers at
test_translit_persian:
Passedسَرْاَنْجَام‏sar-anjāmsar-anjām
Passedکُروزkurōzkurōz
Passedدَهْdahdah
Passedدَهdada
Passedسُؤَالsu'ālsu'āl
Passedکُرُوزkurūzkurūz
Passedوَاوْwāwwāw
Passedنَوْروزnawrōznawrōz
Passedقَهْوَه‌اِیqahwa-īqahwa-ī
Passedقَهْوَه‌یِیqahwa-yīqahwa-yī
Passedخْوَانْدَنxwāndanxwāndan
Passedخْویشxwēšxwēš
Passedخْوَدxwadxwad
Passedچَامَه‌سَرَایِیčāma-sarāyīčāma-sarāyī
Passedطَنِینtanīntanīn
Passedلِهٰذَاlihāzālihāzā
Passedقَهْرًاqahranqahran
Passedعَصاًasanasan
Passedخَانَهxānaxāna
Passedکورِیَایِ شُمَالِیkōriyā-yi šumālīkōriyā-yi šumālī
Passedضَمَّهzammazamma
Passedضَمِّهْzammihzammih
Passedکِهkiki
Passedکِهْkihkih
Passedاَرْمَنِسْتَانarmanistānarmanistān
Passedبَاکُوbākūbākū
Passedکَسیkasēkasē
Passedبَرَادَرِ بُزُرْگbarādar-i buzurgbarādar-i buzurg
Passedقُرُونِ وُسْطیٰqurūn-i wustāqurūn-i wustā
Passedدَر-آمَدdar-āmaddar-āmad
Passedبَازِیِ شَطْرَنْجbāzī-yi šatranjbāzī-yi šatranj
Passedایرَانِیَانērāniyānērāniyān
Passedسُؤَالsu'ālsu'āl
Passedصُبَاحsubāhsubāh
Passedصُبْحsubhsubh
Passedصُبْهsubhsubh
Passedدُروغ گویْdurōğ gōydurōğ gōy
Passedاوōō
Passedوَwawa
Passedو u u
Passedبَه نَامِ خُدَاba nām-i xudāba nām-i xudā
Passedجَوَانِیjawānījawānī
Passedشَاهْنَامَهšāhnāmašāhnāma
Passedزِنْدَگِیzindagīzindagī
Passedزِنْدَه‌گِیzinda-gīzinda-gī
Passedمیوَهٔ جَاپَانِیmēwa-yi jāpānīmēwa-yi jāpānī
Passedنُویدnuwēdnuwēd
Passedدُخْتَرَْبَچَّهduxtar-baččaduxtar-bačča
Passedکِیَهkiyakiya
Passedکُرُوَاسِیَاkuruwāsiyākuruwāsiyā
Passedمِیَایِینmiyāyīnmiyāyīn
Passedمْیَایینmyāyēnmyāyēn
Passedطِلَّاtillātillā
Passedلیکِنlēkinlēkin
Passedبَچَّهٔ لَطِیفَه کَلَان اَسْتbačča-yi latīfa kalān astbačča-yi latīfa kalān ast
Passedمَعْرُوف و مَجْهُولma'rūf u majhūlma'rūf u majhūl
Passedمَعْرُوف وَ مَجْهُولma'rūf wa majhūlma'rūf wa majhūl
Passedاَرمنستان(nil)(nil)N/A
Passedباکو(nil)(nil)N/A
Failedتصویر(nil)tswērN/A
Passedکسی(nil)(nil)N/A
Passedبرادر بزرگ(nil)(nil)N/A
Passedقرون وسطی(nil)(nil)N/A
Passedوَٱللّٰهwal-lāhwal-lāh
Passedکَسےkasēkasē
Passedکَٹَهkaṭakaṭa
Passedآیَةُ‌اللّٰهāyatu-l-lāhāyatu-l-lāh
Passedفِالْحَالfi-l-hālfi-l-hāl
Passedبویِ تُوbō-yi tūbō-yi tū
Passedبِسْمِ اللّٰهِ الْرَّحْمٰنِ الْرَّحِیمbismi l-lāhi r-rahmāni r-rahīmbismi l-lāhi r-rahmāni r-rahīm
Passedاِیَالَاتِ مُتَّحِدَهiyālāt-i muttahidaiyālāt-i muttahida
Passedدَارُ الخَلَافَهdāru l-xalāfadāru l-xalāfa
Passedاَبُو الهَوْدabū l-hawdabū l-hawd
Failedییēy1
"https://si.wiktionary.org/w/index.php?title=Module:fa-cls-translit/documentation&oldid=165899" වෙතින් සම්ප්‍රවේශනය කෙරිණි