साँचा:IPA audio filename

मुक्त ज्ञानकोश विकिपीडिया से
Jump to navigation Jump to search

साँचा:IPA audio filename/filename

परिचय का प्रतीक साँचा परिचय[देखें] [संपादन] [इतिहास] [पर्ज]

This template produces the filename of an IPA sound sample (not the sound itself). It can be determined, by default, from the IPA symbol. Example: {{IPA audio filename|m}}साँचा:IPA audio filename/filename. Optionally, a filename can be entered directly. Also optionally, the existence of the file can be checked, and any error can be overridden by any text or a blank.

Usage[संपादित करें]

Full input list is:

{{IPA audio filename
| ipa symbol =
| soundfile  =
| checkexist =
| errortext  =
}}
First parameter or ípa symbol= This first parameter (or named parameter ipa symbol=)is for the IPA symbol. The symbol is translated into the name of the sound (using the list in {{IPAsym}}) and adding the extension .ogg. When the parameter is not used, the input soundfile= should be used. For any symbol, the default name can be permanently overruled through the list (see below).
{{IPA audio filename|ʒ}}साँचा:IPA audio filename/filename
soundfile= (optional, default=none) This parameter allows for entering any literal filename. Input here bypasses (overwrites) the first parameter. It can be used to enter a filename that does not have a default name as {{IPAsym}} produces. Note: when used, this input should have the extension.
{{IPA audio filename|ʒ|soundfile=Accordian chords-01.ogg}}साँचा:IPA audio filename/filename
checkexist= (optional, default=no) Can be "yes" or "no". When entered "yes", and the filename is not an error, the template checks for the existence of the filename. If itdoes not exist, an error is produced. Note: Checking for existance is called an "expensive" function, in that it requires serious server-side action. The number of file checks per page is limited.
{{IPA audio filename|​n̪|checkexist=yes}}File "साँचा:IPA audio filename/filename" does not exist
errortext= (optional, default=none) The errortext entered here overwrites any possible error-output. If there is no error, this errortext is not used. The tradeoff is: it hides any error information, but is cleans up the output. The errortext can be a blank, like {{IPA audio filename|m|errortext=}}.
{{IPA audio filename|abc|errortext=Some error in the filename}}साँचा:IPA audio filename/filename

Permanent altered from default name[संपादित करें]

Some IPA symbols have soundfiles available in Wikipedia that are not the default name. These alternate names can be entered in this template, and will show up in the output.

Subtemplate {{IPA audio filename/filename}} contains the list of alternate names. Example:

  • kʼ is named velar ejective, so this would yield default name: velar ejective.ogg

The filename however differs from that default name. The list in {{IPA audio filename/filename}} produces that different name:

Currently, the next nine non-default names are in the list:

voiceless labio-velar approximant = voiceless labio-velar fricative.ogg (from: ʍ)
alveolar ejective = alveolar ejective plosive.ogg (from: tʼ)
uvular ejective = uvular ejective plosive.ogg (from: qʼ)
bilabial ejective = bilabial ejective plosive.ogg (from: pʼ)
sje-sound = voiceless dorso-palatal velar fricative.ogg (from: ɧ)
velar ejective = velar ejective plosive.ogg (from: kʼ)
labial-velar nasal = labial-velar nasal stop.ogg (from: ŋ͡m)
epiglottal plosive = voiceless_epiglottal_plosive.ogg (from: ʡ)
velar approximant = voiced velar approximant.ogg (from: ɰ)
near-close near-back vowel = near-close near-back rounded vowel.ogg (from:ʊ)
R-colored vowel=Regular and r-colored vowels.ogg (from:ɚ)

Possible errors[संपादित करें]

Three error situations are covered:

  • No IPA symbol entered (and no soundfile name):
{{IPA audio filename}}साँचा:IPA audio filename/filename
  • The IPA symbol may not be defined in {{IPAsym}}:
{{IPA audio filename|abc}}साँचा:IPA audio filename/filename
  • Checkexist=yes is asked, and the file does not exist:
{{IPA audio filename|ⱱ̟|checkexist=yes}}File "साँचा:IPA audio filename/filename" does not exist

These error outputs can be overridden by using errortext=. This can be blank. This only has effect on the output, it does not alter the existing error situation.

Technical background[संपादित करें]

  • The template uses nested sub-templates to prevent re-caculation of repeated data. e.g. the name from {{IPAsym}} is calculated only once, and then passed through to the next subtemplate in the nest. This is more important for the check on existence {{#ifexist:}}, which is "expensive" and should be performed only once. The nesting has three levels: {{IPA audio filename}} calls {{IPA audio filename/main1}} calls {{IPA audio filename/main2}}.
  • Error texts are passed through unaltered. At the end, in /main2, any error is enveloped with the errortext (if provided).
  • Check existence is performed only when the filename is not an error in itself.

Issues[संपादित करें]

  • Todo: the template should accept input "|ipa symbol=...", overriding current unnamed param #1.

Subtemplates used:

See also[संपादित करें]