Template:IPA symbol/doc: Difference between revisions

Content deleted Content added
m Updated transclusion at top of page.
m Reverted edit by 2601:18A:8178:35A0:A058:46D6:3C34:82D9 (talk) to last version by Paine Ellsworth
 
(14 intermediate revisions by 5 users not shown)
Line 1:
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{lua|Module:IPA symbol}}
*This template provides a simple conversion table from an ''IPA symbol'' '''to''' a ''Wikipedia article name''. Its direct use is probably not too meaningful, but it can be useful inside other templates, e.g. {{tl|IPA link}}. It is a meta-template.
{{Contains special characters}}
This template provides a simple conversion table from an ''IPA symbol'' '''to''' a ''Wikipedia article name''.
 
The resulting article name should exist. The input symbol may be multiple characters, or may be a sequence of [[International Phonetic Alphabet|IPA]]-numbers.
 
===Usage===
This template has one parameter that is mandatory. The parameter canmust be an IPA symbol, or ana sequence of IPA-number symbols. ''DoA not useformatting template like {{tlxtl|IPA}} foris the inputnot character''necessary.
 
:* <code><nowiki>{{IPA symbol|m}}</nowiki></code> &rarr; {{IPA symbol|m}}
:* <code><nowiki>{{IPA symbol|114ɡ͡b}}</nowiki></code> &rarr; {{IPA symbol|114ɡ͡b}}
:<code><nowiki>{{IPA symbol|ɡ͡b}}</nowiki></code> &rarr; {{IPA symbol|ɡ͡b}}
Use <code>output=</code> to specify the type of output.
:<code><nowiki>{{IPA symbol|t̪|output=name}}</nowiki></code> &rarr; {{IPA symbol|t̪|output=name}}
:<code><nowiki>{{IPA symbol|t̪|output=wikipage}}</nowiki></code> &rarr; {{IPA symbol|t̪|output=wikipage}}
:<code><nowiki>{{IPA symbol|t̪|output=soundfile}}</nowiki></code> &rarr; {{IPA symbol|t̪|output=soundfile}}
:<code><nowiki>{{IPA symbol|t̪|output=type}}</nowiki></code> &rarr; {{IPA symbol|t̪|output=type}}
 
Use <code>output=</code> to specify the type of the output: "name", "symbol", "article", or "audio".
====Possible errors====
:* <code><nowiki>{{IPA symbol|t̪|output=name}}</nowiki></code> &rarr; {{IPA symbol|t̪|output=name}}
<!--* The first parameter is required:
:* <code><nowiki>{{tlx|IPA symbol|t̪|output=article}} &rarr; <span class="error"/nowiki></code>Error using {{[[template:IPA symbol|IPA symbol]]t̪|output=article}}: No input</span>-->
:* <code><nowiki>{{IPA symbol|t̪|output=wikipageaudio}}</nowiki></code> &rarr; {{IPA symbol|t̪|output=wikipageaudio}}
* <code><nowiki>{{IPA symbol|w̥|output=symbol}}</nowiki></code> → {{IPA symbol|w̥|output=symbol}} (returns the primarily defined symbol)
 
Certain symbols such as the tie bars, length marks, and dotted circle in the input are ignored so long as the rest of the input matches a definition, so that the below do not result in errors even though these individual combinations are not defined in the data.
* If the input argument does not exist in the IPA symbol internal list [[Module:IPA symbol/data]], an error message is returned.
:* <code><nowiki>{{tlx|IPA symbol|pʰɪk}}</nowiki></code> &rarr; {{IPA symbol|pʰɪk}}
:* <code><nowiki>{{IPA symbol|ɡ͡b◌ʰ}}</nowiki></code> &rarr; {{IPA symbol|ɡ͡b◌ʰ}}
This may indicate that you have mistyped the input, or that the translation is not (yet) present in the IPA symbol list. An editor can add the link.
 
If no direct match is found, the template will then look for the earliest instance of a diacritic in the input string.
* Using the {{tlx|IPA}} template will break the workings:
:{{tlx|IPA* symbol|<code><nowiki>{{IPA symbol|p}}</nowiki>}}</code> &rarr; {{IPA symbol|{{IPA|p}}}}
* <code><nowiki>{{IPA symbol|pʰæ̃}}</nowiki></code> → {{IPA symbol|pʰæ̃}}
* <code><nowiki>{{IPA symbol|pæ̃}}</nowiki></code> → {{IPA symbol|pæ̃}}
 
A two-character diacritic takes precedence over a one-character one should they be found at the same position.
* Optionally, an error text can be altered from the default red error message to any text (including a blank) by using the second parameter:
:* <code><nowiki>{{tlx|IPA symbol|pʰɪkʰa}}</nowiki></code> &rarr; {{IPA symbol|pʰɪkʰa}}
:* <code><nowiki>{{tlx|IPA symbol|pʰɪk|unknownʰpa}}</nowiki></code> &rarr; {{IPA symbol|pʰɪk|unknownʰpa}}
:{{tlx|IPA symbol|pʰɪk{{!}}}} &rarr; {{IPA symbol|pʰɪk|}}
<!--:Input position 3 overrules only the errormessage "no input", the other one will show unchanged.
:{{tlx|IPA symbol|{{!}}{{!}}input to be checked}} &rarr; {{IPA symbol|||input to be checked}} (using input position #3) -->
 
Some symbols in the input are automatically replaced by the more suitable counterparts.
Pages with an error are listed in [[:Category:International Phonetic Alphabet pages needing attention]].
* <code><nowiki>{{IPA symbol|’|output=symbol}}</nowiki></code> (right single quotation mark) → {{IPA symbol|’|output=symbol}} ([[modifier letter apostrophe]])
 
===Notes=Data==
The data is stored at [[Module:IPA symbol/data]]. It is divided into two groups: "sounds" and "diacritics". If no "article" is specified, the value for "name" will substitute it. A diacritic must be one or two Unicode characters. The data also stores substitution patterns for the input string.
* Its direct use is probably not too meaningful, but it can be useful inside other templates, e.g. {{tl|IPA link}}. It is a meta-template.
 
==Errors==
====Editing: extending this template====
PagesIf withthe input matches no definition in the data, an error aremessage listedis inreturned and the page will be categorized into [[:Category:International Phonetic Alphabet pages needing attention]].
The entire list is at [[Module:IPA symbol/data]].
* <code><nowiki>{{IPA symbol|xyz}}</nowiki></code> → {{IPA symbol|xyz}}
 
Optionally, an error text can be altered from the default message to any text by using the second parameter (if set to <code>blank</code>, the message will not appear at all). This cancels the addition of the error category.
====Technical notes====
:* <code><nowiki>{{IPA symbol|xyz|output=soundfileunknown}}</nowiki></code> &rarr; {{IPA symbol|xyz|output=soundfileunknown}}
;Just statistics:
:* <code><nowiki>{{IPA symbol|xyz|output=typeblank}}</nowiki></code> &rarr; {{IPA symbol|xyz|output=typeblank}}
* As of November 2010, there are ''566'' lines (i.e. 566 recognised inputs). Of these, 181 are IPA numbers. The 566 inputs lead to 201 outputs (201 Wikipedia article names, that are also the phonetic descriptions).
* As of October 2011, there are ''726'' lines (i.e. 726 recognised inputs). The 726 inputs lead to 249 outputs (249 Wikipedia article names, that are also the phonetic descriptions).
* As of July 2012, after a cleanup, there are 940 input symbols recognised, into 277 Wikipedia article names.
* As of December 22, 2012 (before any cleanup), there are 1043 rows of input leading to 306 article names. No double names detected.
 
===See also===
* {{tl|IPA link}} – Displays an IPA symbol which is automatically linked to its sound article: β &rarr; {{IPA link|β}}
* {{tl|IPAblink}} – As {{tlf|IPA link}}, enclosed in '''square brackets''': {{IPAblink|β}}
* {{tl|IPAslink}} – As {{tlf|IPA link}}, enclosed in '''slashes''': {{IPAslink|β}}
* [[:Category:International Phonetic Alphabet pages needing attention]]
 
{{IPA templates}}<includeonly>
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
{{collapse top|TemplateData}}
<templatedata>
{
"params": {
"1": {
"label": "Input symbol",
"example": "'m'",
"type": "string",
"required": true
},
"2": {
"label": "Error text",
"example": "blank",
"type": "string"
},
"output": {
"label": "Output type",
"example": "audio",
"type": "string"
}
}
}
</templatedata>
{{collapse bottom}}
 
<includeonly>{{sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:IPA symbol templates]]
[[Category:Templates that add a tracking category]]
 
}}</includeonly>