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.

Background[සංස්කරණය]

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).

Usage notes[සංස්කරණය]

  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ēš)

Example[සංස්කරණය]

Test:

Lua දෝෂය in Module:languages at line 690: attempt to index local 'sc' (a nil value).

Result:

Lua දෝෂය in Module:languages at line 690: attempt to index local 'sc' (a nil value).

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


Test cases[සංස්කරණය]

1 of 8 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
Script error during testing: Module:languages:690: attempt to index local 'sc' (a nil value)
stack traceback:
	[C]: ?
	Module:languages:690: in function 'findBestScript'
	Module:links:825: in function <Module:links:782>
	(tail call): ?
	Module:fa-cls-translit/testcases:12: in function 'func'
	Module:UnitTests:295: in function 'iterate'
	Module:fa-cls-translit/testcases:96: in function <Module:fa-cls-translit/testcases:15>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
"https://si.wiktionary.org/w/index.php?title=Module:fa-cls-translit/documentation&oldid=165899" වෙතින් සම්ප්‍රවේශනය කෙරිණි