Jump to content

Module:Detect singular/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
short doc with pointers
 
expand, +cat
Line 1: Line 1:
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->


Lua to determine whether a string is singular or plural. Designed for use in infoboxes, to determine whether labels should be singular or plural based on the corresponding data, e.g.
*See [[Template:Detect singular]] for main() usage. Test cases [[Template:Detect singular/testcases|here]]

*See [[Template:Pluralize from text]] for pluralize() usage (a wrapper around main()). Test cases [[Template:Pluralize from text/testcases|here]]
<code><nowiki>{{#invoke:Detect singular|pluralize|Winken, Blinken, and Nod||singular|plural}}</nowiki></code> → {{#invoke:Detect singular|pluralize|Winken, Blinken, and Nod||singular|plural}}

*See [[Template:Detect singular]] for main() usage. Test cases [[Template:Detect singular/testcases|here]].
*See [[Template:Pluralize from text]] for pluralize() usage (a wrapper around main()). Test cases [[Template:Pluralize from text/testcases|here]].


<includeonly>{{Sandbox other||
<includeonly>{{Sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Infobox modules]]

}}</includeonly>
}}</includeonly>

Revision as of 05:40, 9 January 2022


Lua to determine whether a string is singular or plural. Designed for use in infoboxes, to determine whether labels should be singular or plural based on the corresponding data, e.g.

{{#invoke:Detect singular|pluralize|Winken, Blinken, and Nod||singular|plural}} → plural