This page updated 12 Dec 2007
Version note: Applies to TMG 7 & 8
Sentence Structures are templates that control how the data in the various fields in tags names, dates, place information, or the text of memos will be assembled into finished text when narrative reports are generated. Each Tag Type (Birth, Anecdote, Census, Marriage, College, and so forth) has its own Sentence Structure to generate text appropriate for the event being recorded. Sentence Structures are only used by narrative reports; the Individual Narrative, Ahnentafel, Descendant Indented Narrative, and Journal reports. All other reports and charts use different methods to assemble the data into the report format.
The Sentence Structures supplied with the standard Tags work fine for many purposes. But most users of narrative reports sooner or later find that they want to modify the text generated by these standard Tags. Or, they may want to create some custom Tag Types (see my article on Customizing Your Tags), and find they need to create Sentence Structures so these tags will generate the desired text. This article covers some basic information about modifying and creating Sentence Structures.
Topics Included in this Article
|Understanding the two ways to modify Sentences|
|Deciding to use Local or Global Sentences, Roles, or New Tag Types|
|Where do you modify Sentence Structures?|
|How to create and edit Sentence Structures|
|Managing the automatic end-of-sentence punctuation|
|Sources of additional information on the subject|
In working with Sentence Structures, a key point the understanding that there are two very different places where you can modify Sentence Structures. Recall that each Tag you create in TMG is of one of many "Tag Types" it might be Birth, Marriage, Note, Will, or any of hundreds of others. When you change Sentence Structures, you do it either:
You would generally contemplate changes in Sentence Structures because you have found that the text created by the existing Sentence Structures are not satisfactory for some reason. It could be that you simply want to be able to include the Memo field in the output of a standard Tag Type that doesn't include it by default. Or perhaps you prefer that the description of a certain kind of event flow in a different way. It might be that the narrative for a particular person could be improved by rearranging the text. Or, perhaps, you have come across a type of event that is not a good fit in any existing Tag Type. Depending on the reason the proposed change, and the user's preferences, there are several ways to approach the changes:
Some general considerations on using these tools:
It is easy to get carried way with the excitement of creating new Tag Types or adding Roles to existing ones. I advise moderation, as I see little point in having dozens of Tag Types, or Roles, each of which is used only a time or two. Better, I think, to locally modify Sentences until you are sure you see a need for custom Tag Types or Roles.
Experimenting with global changes to Sentences is relatively safe, at least until you start "polishing" the narratives of selected people, because you can simply change them again. Doing so is a good way to learn about how Sentence Structures work.
It is probably wise to keep the impulse to change sentences locally under some control until one gets a sense of the type of output he or she prefers, and becomes somewhat familiar with how Sentence Structures work. Otherwise it is possible to end up with lots of local sentences that one later wants to change, and those changes have to be made one-by-one.
Once you reach the point of wanting more polished narratives, at least for some people in your Project, in my opinion the best tool is locally modifying selected Sentences for those people. Having available some custom Roles to deal with recurring circumstances is helpful. But especially for people for whom you have considerable information, producing quality text requires hand crafting of the narrative. Using local Sentence Structures in key tags are essential, I believe, in achieving that. Another useful technique is use of sentence variables in Memos, which allows dates, place information, and the names of other participants to be easily inserted into text.
Some users prefer to leave the global Sentences and edit the finished narrative in a word processor. If you expect to produce finished narrative only once for a line, as a professional researcher might, that may work well. But I find I continually produce narrative reports or web pages with Second Site using different groupings containing many of the same people. I see no need to continually polish the narratives for the same people time and again, when I can make those changes in TMG and have them reflected each time that person appears in a report of web page.
Once you start polishing narratives for some people, global changes in sentences should be carefully considered. Typically I find only a few Tags need local Sentences to produce flowing text for a given individual, with most Tags retaining their global Sentences. If you later change those global Sentences, the carefully polished narrative may no longer read as you planned because the flow of the narrative from Tag to Tag has been changed.
No matter whether you are adjusting the Sentence Structure locally for an individual Tag, or globally for a Tag Type, the procedure is the same - the difference is the screen you work with, as described below.
1. To modify the Sentence Structure of a Tag Type globally, you open the Tag Type Definition screen. You open that screen from the Tools > Master Tag Type List menu, by clicking the Tag Type button on a Tag Entry Screen, or clicking the + button on Toolbar:
Select the Tag Type you want to edit from the list, and click the Edit button to open the Tag Type Definition screen:
Click on the Roles and Sentences tab, and select the Role you wish to modify in the Roles list on the left side of the of screen. By default, all Principals will be assigned the Role of "Principal" and all Witnesses will receive the Role of "Witness." Unless you want to explore additional Roles, these two are the only ones you need to deal with. See my article on Roles for more information on using other Roles
You modify the Sentence Structure in the field to the right. For most Tag Types only the "Male sentence structure" is used; it is applied to everyone unless there is an entry in the "Female sentence structure (if different)" field. That field is used in those cases were different wording is required for female subjects. A primer on editing the Sentence Structures themselves is found below in the section "Writing Sentence Structures."
2. You modify the Sentence Structure locally for an individual Tag in the Tag Entry Screen. You access that screen for an existing Tag by double clicking on the tag name. That is also the screen you access in the course of creating a new Tag:
To modify the Sentence Structures for the Principal(s) at the top of the screen, click the Sentence button in the lower left to open the Sentence Structures screen:
Select the Role you want to modify, and edit the Sentence Structure in the large field below. If the Tag has two Principals, the Roles of each will be listed, and you can select either to modify that Principal's Sentence.
In this screenshot, the word "(Default)" appears above the Sentence Structure field, indicating that we have not yet edited the Sentence in this Tag, so the Sentence displayed is the Global Sentence Structure from the Tag Type. Once the we make changes in this screen, the "(Default)" label will disappear.
A preview of the output of the Tag is displayed in the lower part of the screen. See my article on Sentence Previews for more on this feature.
To modify the Sentence Structures for Witnesses, open the Add Witness screen. Do this by clicking on the + icon for a new witness (see screenshot of Tag Entry screen above), or double-clicking on an existing witness entry (on the Other Witnesses tab if you are using the tabbed version of the Tag Entry screen):
Edit the Sentence Structure in the "Sentence" field. Note that when you are editing Sentences for Witnesses locally, each Witness in a Tag has his or her own Sentence, so you can customize the Sentences specifically for each Witness if you like. A preview of the output appears at the bottom of the screen, as with the Sentence Structures screen.
Now that we have seen where the Sentences are changed, we need to look at the specific changes we might make. The first step is to figure out how you want the text in the report to read, or exactly how you want to change the existing rendering. Only then can you begin to craft the new or revised Sentence itself.
Looking at the existing Sentence may offer clues. For example, look at the standard Sentence Structure for the Birth Tag, visible in the "Sentence Structure" screenshot above:
[P] was born <[D]> <[L]>
The letters in square brackets like "[P] " are "variables" representing where items recorded in various fields of the tag will be fit into the finished text. The variables in this example are:
[P] stands for "Principal" the person whose ID# is entered in the Tag. This variable will cause either the name of that person to be printed, or if this is not the first sentence of the report paragraph, the pronoun he or she.
[D] stands for "Date" the date entered in the Tag's Date field. The way the date is formatted is controlled by settings in the Report Definition for the particular report being generated, and in Preferences > Program Options > General.
[L] stands for Location the information entered in the several place fields on the Tag. The way the information is formatted is controlled by settings in the Report Definition for the particular report being generated.
A full list of available Variables is available my List of Sentence Variables, or can be found by searching Help for "Variables" then look for "Variables:Event tags" in the list that is produced. Most are also found on the right-click menu in the Sentence Structure and Memo fields:
You can simply type variables in the Sentence Structure field. Or, click the spot where you want the variable to be inserted, right-click, and choose the desired variable. Here, the Memo variable, [M], has been selected.
The angle brackets on some variables like " <[D]> " in the birth tag Sentence are called conditional brackets. They tell the program to is simply ignore whatever is included between them if the field referenced by the variable is empty. If these brackets are omitted and the indicated field is empty, a phrase like "unknown value" appears in the text in the place of the missing data.
The punctuation marks and any text like "was born" in the birth tag Sentence appears in reports exactly as they are written in the Sentence Structure.
The following screenshot shows the result of a simple change to the global Sentence Structure of the standard Birth Tag Type:
Here the variable for the Memo field, [M], has been added to the Sentence Structure, allowing us to record any details we might want to include about the birth. We might want to something like "on the voyage to New York," for example. Note that the variable has been included in conditional brackets, so for birth Tags in which nothing is entered in the Memo field, the added variable will be ignored. But for those cases where we do include a remark in the Memo field, that text will be included in the narrative automatically. Use of conditional brackets is generally a good idea when adding variables globally, because often that field will be used in some cases but not others, and with the conditional brackets the Sentence works well in either case.
One trick for successfully editing Sentence Structures is to test your results by creating a small report that includes the tag being modified. Make some trial modifications, then run a test report. If the sentence doesn't appear as you had hoped, go back and try again. TMG has a button on the Reports Toolbar that creates a helpful preview report in Individual Narrative format. If you prefer to see your previews in another report format, you can add your own button to the Custom toolbar to create whatever style report you prefer.
By default TMG removes any punctuation at the end of the text output by each tag in narrative reports and applies a period. There is an exception for certain recognized punctuation supplied by the user, such as a question mark, which is retained. If you need different results, a special code retains any user-supplied punctuation and prevents the addition of a period where none is provided by the user.
The [:NP:] code can be typed into the Sentence field, or added by selecting "No Change to Punctuation" from the right-click menu. It can be placed anywhere in the Sentence, but placing it at the end avoids some obscure issues with some reports.
Some suggested applications for this code include the following:
Using a Tag for only an exhibit, with no text output. Use of the new code eliminates the stand-alone period that would otherwise be generated.
Creating text ending with final punctuation not recognized for that purpose by TMG, such as a colon.
For further information on this topic, I suggest:
Review the related topics in Help, or in the TMG manual, for a full description of the many options and features available for constructing Sentence Structures.
I have complied a full list of available Sentence Variables, and special control characters, with explanations.
For some examples of use of customized Sentence Structures, see my articles on Customizing Your Event Tags.
There are several items on this subject on Lee Hoffman's TMG Tips Page.
There is a section on Sentence Structures in the Wholly Genes Forum.
And of course, the most complete discussion (I think ) is in Chapter 6 of Getting the Most Out of The Master Genealogist.
The Second Edition of my sell-out book, A Primer for The Master Genealogist, is now available.
Details are can be seen here.
Copyright 2000- by Terry Reigel