Difference between revisions of "Template:Article"

From Abulafia Random Generator Wiki
Jump to navigation Jump to search
Line 8: Line 8:
 
         an {{{1}}}|
 
         an {{{1}}}|
 
         {{#ifeq:{{lc:{{#sub:{{{1|}}}|0|1}}}}|o|
 
         {{#ifeq:{{lc:{{#sub:{{{1|}}}|0|1}}}}|o|
           an {{{1}}}}|
+
           an {{{1}}}|
 
           {{#ifeq:{{lc:{{#sub:{{{1|}}}|0|1}}}}|u|
 
           {{#ifeq:{{lc:{{#sub:{{{1|}}}|0|1}}}}|u|
 
             an {{{1}}}|
 
             an {{{1}}}|

Revision as of 23:18, 8 June 2009

This function adds a Indefinite Article to the beginning of the phrase sent to it. The intelligence that it follows is thus: If the string passed starts with "uni" (a university, a unicycle), it gets preceded by an "a". Otherwise, if it starts with a vowel, it gets preceded by an "an". Otherwise (it starts with a consonant), it gets preceded by an "a". This will catch most situations, but not all, since there are likely other phonetic combinations other than "uni" that start with a vowel, but give a consonant sound that should be an "a", that can be coded in as they are located.

Usage

{{Article|aardvark}} in the text of an article yields "a aardvark" in the render of the page. You can use this template in the flow of a SGTable output (which is its most useful state, when you don't know what the text will be coming out of that generator), such as:

  Reload
Generator

<sgdisplay iterations="1">I went out walking and ran across a [Animal.fantasyLand], a [Animal.fantasyLand], a [Animal.fantasyLand], a [Animal.fantasyLand], a [Animal.fantasyLand], a [Animal.fantasyLand], and a [Animal.fantasyLand].</sgdisplay>

In that list, it should show that all animal names that start with a vowel get a "an" in front of them (reload the page if no vowel-first animals appeared).

The template "ia" (for "indefinite article") is a shortcut to this template, and can be used as {{ia|aardvark}} interchangeably, if you prefer a shorter command.