* Narrative Reports Sentence Templates

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Narrative Reports Sentence Templates

Post by NickiP » 17 Apr 2016 10:29

I've been reading about Functions and searching on FHUG but can't find anything to answer my query, unless of course I've missed it.

Is it possible to combine two Facts into one Narrative Report sentence?

What I'd like to avoid repetition is to have a sentence that reads "She/He was born [date] [location] and baptised ..." where both a Birth and Baptism Fact exist?

I want to keep both Facts configured in FH but would prefer to avoid two sentences in a Narrative Report where both Facts exist, which tends to be the minority of individual records as mainly its one or the other.

Would it be possible for some condition to be attached to the sentence templates for both Birth and Baptism so that this only appears where both Facts exist so that I don't have to manually edit the templates each time I want it to show please?

Thanks

Nicola

avatar
Shelley
Platinum
Posts: 44
Joined: 07 Aug 2011 06:33
Family Historian: V6.2
Location: Australia

Re: Narrative Reports Sentence Templates

Post by Shelley » 17 Apr 2016 14:35

Hi Nicola,

Yes it is possible. I think the rather convoluted templates below should work.

A possible drawback in doing this is losing baptism-only source references in the report. I suspect they wouldn't carry through, but I haven't tested it.

For the birth sentence:

{individual} was born {date} {place} {=TextIf(Exists(%CUR_PRIN.BAPM%),Text("and was baptised" . TextIf(IsSet(%CUR_PRIN.BAPM.PLAC%), Text(" in ". %CUR_PRIN.BAPM.PLAC%),"") . TextIf(IsSet(%CUR_PRIN.BAPM.DATE%),Text(" on ". %CUR_PRIN.BAPM.DATE%),"")),"") }.

For the baptism sentence:

{=TextIf(Exists(%CUR_PRIN.BIRT%),"" , Text(%CUR_PRIN% . " was baptised" . TextIf(IsSet(%CUR_PRIN.BAPM.PLAC%),Text(" at ". %CUR_PRIN.BAPM.PLAC%),"") . TextIf(IsSet(%CUR_PRIN.BAPM.DATE%),Text(" on ". %CUR_PRIN.BAPM.DATE%),""))) }<The godparents were {role(plural)=godparent}. ><The godparent was {role(single)=godparent}. ><The ceremony was conducted by {role=minister}. ><The ceremony was conducted by {role=priest}. >

I had a few near misses on simpler templates. For example "{individual} was born {date} {place}< and {%CUR_PRIN.BAPM%}>." almost gets there, but the word baptism has a capital letter that I couldn't get rid of.

If someone has a more elegant solution I'd like to use it myself.

Shelley

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 17 Apr 2016 14:46

Thanks very much Shelley, I shall have a look.

Nicola

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Narrative Reports Sentence Templates

Post by tatewise » 17 Apr 2016 15:37

Nicola, if I understand your original request, you only want the sentence to say 'and' instead of 'She/he was' when both Birth and Baptism exist.

The complexity proposed by Shelley can be avoided if you were happy with "She/He was born [date] [location]. Then baptised [date] [location]."

This avoids the problem of eliminating the sentence full stop, and allows any citation cross-refs for both Birth and Baptism to be retained.

All its needs in the Baptism Fact is something like:
{=TextIf(Exists(%CUR_PRIN.BIRT%),"Then", Sex("He was","She was") )} baptised...
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 17 Apr 2016 16:33

What I'd like is affectively to merge the two Facts into one sentence instead of there being two. Shelley's suggestion does what I am looking for but there is the issue of the missing Baptism Source when it applies.

Mike, I really just want to join the sentences for the two Facts with an "and" not a "then", assuming I'm reading your suggestion correctly, which I may not be.

However, because I don't have birth and baptism dates for all Individuals in the trees, it would need to be able to work as normal in those circumstances when only one exists. Shelley's suggestion for the Baptism sentence does indeed work where there is no Birth Fact, albeit that the date and place statements appear in these circumstances around the wrong way with the location first and date second, I normally have date first and location second but I would imagine that is down to the order of the template.

Is there any way of maintaining the Sources in the Narrative Reports for the Baptism Facts where this applies other than adding the Baptism Source to the Birth Fact when it doesn't actually relate to the Birth Fact?

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Narrative Reports Sentence Templates

Post by tatewise » 17 Apr 2016 17:44

The snag is that you cannot currently merge the sentences from two facts, i.e. eliminate the full-stop.

The solution from Shelley, or any alternative, that composes the entire sentence from one fact and omits the sentence from the other fact, will suffer the problem of citation refs missing from the omitted sentence. So the answer to your last question is "NO".

I was attempting a compromise, in which the repetitive She/He was is avoided, but both sentences exist.

What about:
"She/He was born [date] [location]. The baptism was [date] [location]."
e.g.
{=TextIf(Exists(%CUR_PRIN.BIRT%),"The baptism was", Sex("He was baptised","She was baptised") )} {date}...

Yes, the order of the {date} and {place} codes determines the order in the sentence.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 17 Apr 2016 18:52

Having had a play with Shelley's suggestion, and ignoring the issue with the Baptism Source, it works fine apart from when there is no Birth Fact. In that circumstance, the Narrative Report shows, rather than "He/She" "[Individual's name]" was baptised {place} {location}, and then the next sentence it states who here parents were and then the details. I suspect this is because of the missing {individual} so unfortunately that's a non-starter in that form because of that problem, but thank you Shelley for the suggestion.

One last question, as I'm wondering whether to keep the Birth Fact but amend the Baptism Fact sentence template with:

{individual} <was born {=GetLabelledText(%FACT.NOTE2%,"Birth:")} and>baptised {date} at {_place}<, {note}>. <The godparents were {role(plural)=godparent}. ><The godparent was {role(single)=godparent}. ><The ceremony was conducted by {role=minister}. ><The ceremony was conducted by {role=priest}. >

I would then have a "Birth:" in the Note section of the Baptism Fact with the birth details.

Obviously I would also have to add the Birth Sources to the Baptism Source so that they would show.

Is there a way of configuring the Birth Fact Sentence to include the "{individual} was born {date} {place}<, {note}>" but preceding it with a statement to check if a Baptism Fact exists and ignore if one does exist please? It would obviously need to be at the beginning of the Sentence Template and say not to print the sentence if the Baptism Fact exists, but I need to have the rest of the Sentence Template to remain the same so that it reads correctly where no Baptism Fact exists?

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Narrative Reports Sentence Templates

Post by tatewise » 17 Apr 2016 20:11

Unfortunately, you cannot include Sentence Template codes such as {individual} or {date} or {place} within functions. Which is why Shelley's templates fail and what you request is not possible.

See New Wish List Request Integrate Functions and Sentence Template Codes (13416) B) Functions to support Template Codes.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 17 Apr 2016 23:34

Is there any way of removing the automatic full stop at the end of each Fact sentence template (whether standard or custom) and stop the first word in each sentence being capitalised? That would fix my issue albeit I would have to manually edit the Fact sentences where required, but to be honest I'd be happy with that as it would enable me to resolve the annoyance of not being able to easily merge the Birth and Baptism Facts into a single sentence.

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Narrative Reports Sentence Templates

Post by tatewise » 18 Apr 2016 08:58

No, you cannot eliminate the full-stop nor avoid the capitalisation within FH Sentence Templates. Don't you think I would have suggested how to do that if it was possible?

The only alternative, is to Save Report As > Word-processor Document (RTF) and post edit it in a word-processor such a MS Word. If you suitably adjusted the Sentence Template then it should be possible to perform a global Find & Replace. However, some users complain that the Word-processor Document (RTF) format does not always retain the original document layout, particularly regarding images.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 18 Apr 2016 11:01

Sorry I asked ...

Exporting to RTF and using a text editor may be the "prefered" suggestion in these circumstances, but its not the only way. As I've posted on another thread on here, you can export to PDF and open it up in the free Libre Office which then allows you to manually edit the formating and text. Its fiddly and time consuming but at least removes the issue of not retaining the formating for images, etc, in the Narrative Report.

Perhaps you might consider directing this to people's attention in future rather than simply suggesting the RTF export all the time. Admittedly, because of the need to add extra spaces if bold is used, its not something for the novice but it does resolve some of the issues that the lack of a decent Report Editor in FH causes while retaining the positioning of media. You can resave as a PDF.

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Narrative Reports Sentence Templates

Post by tatewise » 18 Apr 2016 12:51

Sorry, I keep forgetting about the LibreOffice and OpenOffice ability to 'edit' PDF, although they effectively use their Drawing tools, so it is not clear that if you make significant 'text' changes that the word-wrap to line-length works as a word-processor, or you finish up with short or long lines? Also, because they use Drawing tools, I suspect global text Find & Replace is not possible.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 18 Apr 2016 13:51

Yes the wordwrap function in Libre Office isn't great but you just have to add extra spaces where needed to move the text along in the various text boxes and if necessary physically move some text to another line. I've not tried "find and replace in it", I was initially interested because of being able to apply bold to more people's names than the reports themselves provide. Yes its time consuming and fiddly but at least it allows for perhaps a final print of a report to have amended formating. I wouldn't use it for "interim" reports but its better than nothing until if and when Calico Pie provide the facility in FH itself. Such a facility really would make it an even better software program than it currently is.

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 20 Apr 2016 10:21

tatewise wrote:Sorry, I keep forgetting about the LibreOffice and OpenOffice ability to 'edit' PDF, although they effectively use their Drawing tools, so it is not clear that if you make significant 'text' changes that the word-wrap to line-length works as a word-processor, or you finish up with short or long lines? Also, because they use Drawing tools, I suspect global text Find & Replace is not possible.
Find (Ctrl+F) and Find & Replace (Ctrl+H) does work on PDFs in LibreOffice, as does the Replace All functionality although it's probably safer to do them all individually because you will often find you need to fix the text box spacing after changing to bold letters or a capital letter. That said, compared to having to manually fix the formating issue with media in RTF exports from Family Historian, this is, in my view at least, preferable as you keep the formating of media.

User avatar
mezentia
Superstar
Posts: 277
Joined: 12 Jan 2007 21:14
Family Historian: V7
Location: Stourbridge

Re: Narrative Reports Sentence Templates

Post by mezentia » 20 Apr 2016 20:09

This is something I've been looking at for census facts that have been recorded using AS. Rather than have up to four sentences, I'd like one, such as:

Bill Smith appeared on the census for 1881, aged 77, living at 123 High Street, Clerkenwell, Middlesex, England, where his occupation was given as Retired policeman and he is recorded as being deaf.

Clearly this depends on the ability to perform some conditional processing within the sentence template so that all the facts for a specific date can be drawn together and a suitable sentence formed. I did speak about this to Simon at WDYTYA Live, but as the stand was rather busy, we didn't have time to examine the possibilities, except to suggest that it isn't actually possible in the current version.

OK, I can export a report to a word processor, but editing multiple census sentences for multiple people gets might tedious :(

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Narrative Reports Sentence Templates

Post by tatewise » 20 Apr 2016 20:20

That is potentially a bit easier to solve by compiling the entire sentence in the Census fact, with conditional components for an Occupation fact with same Date, and other facts with same Date.

The Occupation and other facts would have to inhibit their sentence if their date matches a Census Date.

This scenario is unlikely to suffer the problem that Birth and Baptism facts pose, where either or both facts may have different citations, and so both must produce sentences to which citation cross-refs can be attached. All the Census related facts will have the same citation, so even if only one of them produces a sentence the cross-ref will be attached.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 20 Apr 2016 23:45

mezentia wrote:This is something I've been looking at for census facts that have been recorded using AS. Rather than have up to four sentences, I'd like one, such as:

Bill Smith appeared on the census for 1881, aged 77, living at 123 High Street, Clerkenwell, Middlesex, England, where his occupation was given as Retired policeman and he is recorded as being deaf.(
This is one of the main reasons why I don't use AS and enter the data manually in FH itself. I've configured my Census sentence template as:

{date}, the night of the Census, {individual} was resident at {_place}<, {note}>

and just manually add the data I required into the {note} section in the form I want it to read.

I've amended other sentence templates similarly, although in many of their cases I've used the {=GetLabelledText(%FACT.NOTE2%,"Note:")} and changed "Note" for other words so that I can keep the sections separate in the Fact Note box. For example, I have a Custom Fact called Criminal and the sentence template is:

{individual} was convicted of {=GetLabelledText(%FACT.NOTE2%,"Offence:")} {date} at {=GetLabelledText(%FACT.NOTE2%,"Court:")} held at {_place}. {=GetLabelledText(%FACT.NOTE2%,"Note:")}

One of the major advantages of Family Historian is the fact that it is so customisable and you can use it just how you want. :)

avatar
jbtapscott
Superstar
Posts: 483
Joined: 19 Nov 2014 17:52
Family Historian: V7
Location: Corfu, Greece
Contact:

Re: Narrative Reports Sentence Templates

Post by jbtapscott » 21 Apr 2016 05:11

Don't forget, you can actually modify the AS Census Templates to have it put some fields in the Notes for an Individual automatically - I have "Relationship to Head of Household", "Marital Status" and "Occupation" all actioned in this way Thus, after adding the Census details via AS, on the Narrative Report, it shows against the Individual as "He appeared in the census on 5 April 1891 at 31 Twynrodyn Road in Merthyr Tydfil, Glamorganshire, Wales - Relationship to Head of Household: Head, Marital Status: Married, Occupation: Baker".
Brent Tapscott ~ researching the Tapscott and Wallace family history
Tapscott & Wallace family tree

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Narrative Reports Sentence Templates

Post by tatewise » 21 Apr 2016 09:08

Yes, Nicki, I think you underestimate the capabilities of AS for its options and templates to be customised to your needs.

e.g. For Census data entry, it can be designed to only create Census Events and put Occupation and other details into the associated labelled Note text, almost exactly as you describe. You would not then have to manually add that data because AS would do it for you automatically from the transcript you enter from the Census document.

It is advisable to adopt the same strategy for BMD Certificates and other facts, such that Occupation is only ever recorded as labelled Note text, and never as a separate Occupation Attribute fact. That consistency is important if you want to perhaps analyse Occupations across your database. Bear in mind that features such as Tools > Work with Data > Occupation will not work with that strategy.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
NickiP
Famous
Posts: 192
Joined: 26 Feb 2013 12:36
Family Historian: V7
Location: UK

Re: Narrative Reports Sentence Templates

Post by NickiP » 21 Apr 2016 12:09

tatewise wrote:Yes, Nicki, I think you underestimate the capabilities of AS for its options and templates to be customised to your needs.
Possibly, possibly not, but the fact remains that AS doesn't allow for Census Family Facts to be created as far as I can see and with 50+k entries over four trees, I'm not inclined to have too much repetition within Narrative Reports. In any case, I don't want a transcript showing in the Source section or, as jbtapscott, suggests "Relationship to Head of Household", I want the data showing in the narrative section as properly worded sentences, something I cannot see is at all possible with AS. And my approach isn't simply limited to Census information.

While I appreciate that AS is reguarly pushed on FHUG as the best solution for data entry, and I accept it is a good free product, it doesn't work for everyone and sometimes its better to manually enter the data and ensure that the sentence template wording is more suitable to Narrative Reports. It very much is down to how people wish to work and the beauty of FH is that it is highly customisable.

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Narrative Reports Sentence Templates

Post by tatewise » 21 Apr 2016 12:25

Put to one side that AS does not support Census (family) facts, and I understand why you prefer them.

If you do not want Census or BMD Certificate transcripts in the Source record then AS can omit them.
But even if included, they can be omitted from any FH Report via the Report Options > Sources tab.

If you do not want Relationship to Head of Household labelled Note text then AS can omit them.
But even if included, it has no impact on Narrative sentences if the FH Sentence Templates ignore that label.

AS does NOT adjust FH Sentence Templates, but with the labelled Note text it does produce, you can apply the Sentence Templates much as you do now, to create properly worded Narrative sentences.

The beauty of AS is that it is highly customisable.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply