Difference between revisions of "Template:Article"

From Abulafia Random Generator Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
<includeonly>{{#ifeq:{{lc:{{#sub:{{{1|}}}|0|2}}}}|un|
+
<includeonly>{{#ifeq:{{lc:{{#sub:{{{1|}}}|0|3}}}}|uni|
 
   a {{{1}}}|
 
   a {{{1}}}|
 
   {{#ifeq:{{lc:{{#sub:{{{1|}}}|0|1}}}}|a|
 
   {{#ifeq:{{lc:{{#sub:{{{1|}}}|0|1}}}}|a|
Line 18: Line 18:
 
   }}
 
   }}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
This function adds {{Article|Indefinite Article}} to the beginning of the phrase sent to it.
+
This function adds {{Article|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" ({{article|university}}, {{article|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 ==
 
== Usage ==
 
<tt><nowiki>{{Article|aardvark}}</nowiki></tt> in the text of an article yields "{{Article|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:
 
<tt><nowiki>{{Article|aardvark}}</nowiki></tt> in the text of an article yields "{{Article|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:
  
<sgdisplay iterations="10">I went out walking and ran across '''{{Article|[Animal.fantasyLandAnimal]}}'''.</sgdisplay></noinclude>
+
<sgdisplay iterations="10">I went out walking and ran across '''{{Article|[Animal.fantasyLandAnimal]}}'''.</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).</noinclude>

Revision as of 08:18, 26 August 2008

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:

<sgdisplay iterations="10">I went out walking and ran across a [Animal.fantasyLandAnimal].</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).