Changes

300 bytes added ,  14:15, April 12, 2012
indicate possible alternative formulations
Line 43: Line 43:  
:When there are several items on the right hand side separated by commas, just one of these items can be selected.  
 
:When there are several items on the right hand side separated by commas, just one of these items can be selected.  
 
:The comments preceded by "#" are not part of the generative grammar, but hopefully will help folks understand the example a little better.
 
:The comments preceded by "#" are not part of the generative grammar, but hopefully will help folks understand the example a little better.
−
:The use of ''italics'' and '''boldface''' is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.
      
By making appropriate substitutions we can generate such sentences as:
 
By making appropriate substitutions we can generate such sentences as:
Line 59: Line 58:     
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.
 
The simple grammar defines a few words which can be substituted for ''Determiner'', ''Noun'', and ''Verb''. There are two possibilities for ''Determiner'', three for ''Noun'', and three for ''Verb'', with both ''Determiner'' and ''Noun'' appearing twice in the expansion. Hence the total number of grammatical sentences which can be generated by this simple grammar is 108 (= 2 * 3 * 3 * 2 * 3). In this particular case the possible words have been carefully chosen so that all of these 108 sentences also actually mean something.
 +
 +
Note that the use of ''italics'' and '''boldface''' in this example is merely a convenient way of indicating the difference between items which can be expanded further (e.g. concepts such as ''NounPhrase'') and items which can not be expanded further (e.g. words such as '''girl'''). In the linguistic literature, items which can be expanded further are referred to as 'non-terminal' items, while items which can't be expanded further are known as 'terminal' items.
 +
 +
The 'comma' notation for alternatives is a form of shorthand. In some formulations this would be shown as several separate rules, so that:
 +
  ''Determiner'' ->  '''a''', '''the'''
 +
could be shown as two rules:
 +
  ''Determiner'' ->  '''a'''
 +
  ''Determiner'' ->  '''the'''
    
==Caution==
 
==Caution==
SkipCaptcha
265

edits