wg2.jpg (6388 bytes) TMG
Sentence Tutorial

(Note: This is applicable to all versions of TMG.)

General.  Many TMG users are apprehensive about Tag and Witness Sentences and indicate that they don't understand how to create the Sentence Structures.  However, most users find that after they have worked with Tags and Sentences just a little bit that they don't have any problem creating Sentence Structures with no problems at all.

The standard Tags come with default Tag Sentences and Witness Sentences that cover almost all the normal needs.  It is the unusual that always seems to occur that causes the new user to finally bite the bullet and try to make the change.

I think the easiest way to learn how to create Sentence Structures in TMG is first write out the sentence as you want it to appear in the narrative reports.  Then replace the data in the Tag fields with the appropriate Sentence Variables. For example, let's use the Occupation Tag.  You might want the sentence to read: "John Smith was a farmer on 1 Aug 1910 in Montgomery County, Kentucky." 

Remember that each tag has one or two Principals (usually the subject of the sentence), a Date field, the Place fields, and the Memo field.  The Date, Place and/or Memo would most often go into the rest of the sentence after the verb which is very often the name of the tag (although it could be in the Memo, if desired).  In our example, we'd replace the "John Smith" part of the sentence structure with the Principal variable "[P]".  The "a farmer" portion would be placed in the Memo field and that variable is "[M]".   The Date variable is "[D]", and the place variable is "[L]".  Thus the Sentence as we have it now is: "[P] was [M] on [D] in [L]".  Once you have put the variables in place of the data (fields), then with some exceptions, that is basically it and the sentence would print as we wanted it.

If you have a Tag field that may be empty in some tags then you would want to enclose that variable in angle "< >" brackets. Otherwise, the sentence will print "unknown date" or "unknown place."  These variable are then called conditional variables because the field is ignored if it is empty when the sentence is printed.  Thus the date and place field may not always be known, so we put the brackets around those variables: "[P] was [M] on <[D]> in <[L]>".   Of course, if the date and/or place fields are empty, we don't want the prepositions "on" and "in" to print, so we include them in the brackets like this: "[P] was [M] <on [D]>< in [L]>".  

This seems to do the job and will do okay in many cases, but dates are not always full dates and we'd have to revise the sentence for the appropriate preposition, "in," every time we didn't have a full date.  The solution here is to let TMG automatically generate the appropriate preposition.  So we take the prepositions out of the Sentence Structure and then it looks like this: "[P] was [M] <[D]>< [L]>".

In many cases, the sentence will only be needed for the one Principal, but there may be times when the second Principal is entered and you will want the default sentence to allow for that situation.  Thus you would want the sentence to print with just the one principals or with both principals.  For example, a tag with two principals would be represented with the variables [P] (the one principal) and [PO] (the other principal).  In this case, you might want a sentence structure to start something like: "[P] and [PO] ...."  This would work fine if both principals are entered in the tag at all times.  But if there are times when only one principal is shown, then you would want to make the second principal to be conditional, like this: "[P] <and [PO]>...."  This seems to do okay until you start adding the rest of the sentence and realize that the verb changes depending on whether you have one person as the subject or more than one.   Thus you need to add the verbs within the conditional brackets and provide TMG an indicator to tell TMG which verb to use.  This indicator is the vertical bar "|" (read it as "or") and is used like this:  "[P] <was|and [PO] were>...." -- which can be read as "the principal was ..." or "the principal and the other principal were ...."

Now our Sentence Structure looks like this: "[P] <was|and [PO] were> [M] <[D]><[L]>" and the result would print like we wanted it above: "John Smith was a farmer on 1 Aug 1910 in Montgomery County, Kentucky.   If we added a second principal, then we would want to enter the Memo entry accordingly ("farmers" rather than "a farmer") and the printed result would be: "John Smith and Sam Jones were farmers on 1 Aug 1910 in Montgomery County, Kentucky".

This is how the standard Occupation Tag's default Sentence is created.   For variety in your reports, you may want to arrange the Sentence such that the date comes first, or the place comes first or some other arrangement.  This would allow you to create reports that weren't so monotonous in the way they read. The Sentence Structure rules are flexible enough that it allows correct grammar using almost any sentence construction.

Splitting the Memo field.  There are times when you will want to have multiple Memo fields and TMG provides that by allowing you to split the field into as many as nine Memo entries or Memo "sub" fields.  Each "sub" field is separated from the next by a delimiter "||".   The delimiter is formed by using two vertical line characters (as used above for the "or" indicator).   Each Memo "sub" field or segment is then numbered beginning with the first through the last and given the variables "[M1]", "[M2]", "[M3]", ..., "[M9]" for a total of nine segments.   For example, consider the Occupation Tag whose default Tag Sentence is:
                                            "[P] <was|and [PO] were> [M] <[D]> <[L]>".
But maybe you want the Occupation Sentence above to read:
            "John Smith was a farmer on 1 Aug 1910 in Montgomery County, Kentucky where he raised tobacco".  
In this case the entry in the Memo field would be:
                                            "a farmer||where he raised tobacco"
This shows the Memo field split into two segments -- [M1] refers to the "a farmer" segment, and [M2] refers to the "where he raised tobacco" segment.  The revised Sentence Structure for our tag would be like this:
                            "[P] <was|and [PO] were> [M1] <[D]><[L]> [M2]".

As another example, consider the Mil-Beg Tag Sentence:
                           "[P] <|and [PO]> began military service <[D]> <[L]><[M]>"
but wanted the printed sentence to read like:
                           "As a private on 31 Jul 1862, he began military service with Capt. Johnson's company
                           at Owingsville, Kentucky when Colonel Jones formed the 98th Infantry."
The Memo field would be entered like:
                    "As a private||with Capt. Johnson's company||when Colonel Jones formed the 98th Infantry"
and the Tag Sentence would be changed to:
                           "[M1] <[D]>, [P] <|and [PO]> began military service <[M2]> <[L]><[M3]>".

These last examples would be typical of  when you would adjust the Tag Sentence on an individual basis rather than globally within the Tag Type entry screen.

Living or Not Living.  Most sentences are based on reports about persons that are no longer living.  But there may be times when you want the reports to print sentences that indicate that the correct living status of people.   Thus we add the two vertical bar delimiter "||" to the Sentence Structure to separate sentences used for those person that are dead and those that are still living. Then the LIVING Flag determines which Sentence Structure to use.  In the case of our Occupation tag above, we might want the default sentence for persons that are dead; but for living persons, we might want a Sentence Structure something like: "[P] <is|and [PO] are> [M] <[D]><[L]>".  Thus the complete Tag Sentence Structure for the Occupation Tag would be: "[P] <was|and [PO] were> [M] <[D]><[L]>||[P] <is|and [PO] are> [M] <[D]><[L]>".   Then if the LIVING Flag was "N", the first sentence would be used, and if the Flag is "Y", the second sentence would be used. 

If you want a sentence to print when the person is deceased, but then to print nothing if the person is still living, just put the two vertical bar delimiter "||" only behind the default Sentence -- "[P] <was|and [PO] were> [M] <[D]><[L]>||".   Similarly, if you want a sentence to print only if the person is living, you would then place the two vertical bar "||"delimiter in front of the sentence -- "||[P] <is|and [PO] are> [M] <[D]><[L]>". 

The "Null" Memo Variable.  At times, you will find that the Memo field will print when you don't want it to print.  Often this will be due to the report options that you have selected or in a Witness Sentence.  In those situations, change the appropriate Sentence Structure for the tag to point to Memo segment zero.  This Memo segment is represented by the variable [M0].   The [M0] by definition is a null or empty field.  Therefore, you should enter the variable within angle brackets.  Then when TMG sees an empty field, it will not print anything.

Refer to the TMG Manual for additional information on Sentence Construction.  The standard TMG Tags and their Default Sentences are shown on another page on this site.

Return to theTMG Tips Tutorial Page

Last revised:

Hit Counter

The pen and inkwell logo is a registered trademark of Wholly Genes, Inc., Columbia, Maryland.