模块:Detect singular/doc
这是模块:Detect singular的文档页面
<templatestyles src="Module:Message box/ombox.css"></templatestyles>
| Warning | This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
<templatestyles src="Module:Message box/ombox.css"></templatestyles>
| 文件:Lua-logo-nolabel.svg | 此-{zh-hans:模块; zh-hant:模組;}-使用Lua语言: |
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|Wynken, Blynken, and Nod||singular|plural}} → plural
- See Template:Detect singular for main() usage. Test cases here.
- See Template:Pluralize from text for pluralize() usage (a wrapper around main()). Test cases here.