* Sentence template formatting
- dewilkinson
- Superstar
- Posts: 280
- Joined: 04 Nov 2016 19:05
- Family Historian: V7
- Location: Oundle, Northamptonshire, England
- Contact:
Sentence template formatting
Interestingly I see a reverse of this regarding marriages in narrative reports, is this a bug that needs reporting to CP?
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Sentence template formatting
David is referring to Source template formatting (21287) that has additional spaces, but this involves Sentence Template formatting which has different rules, so I've started a new thread.
That other thread provided the template which allowed a straightforward solution to be determined.
Without the Sentence Template, it is difficult to identify the cause but I suspect a missing space just before the {date} code.
Unlike Source format templates, Sentence Templates rarely insert spaces automatically.
However, they prune multiple spaces down to one space and may adjust spaces around punctuation, i.e. remove a space before a full-stop and insert a space after a full-stop.
That other thread provided the template which allowed a straightforward solution to be determined.
Without the Sentence Template, it is difficult to identify the cause but I suspect a missing space just before the {date} code.
Unlike Source format templates, Sentence Templates rarely insert spaces automatically.
However, they prune multiple spaces down to one space and may adjust spaces around punctuation, i.e. remove a space before a full-stop and insert a space after a full-stop.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- dewilkinson
- Superstar
- Posts: 280
- Joined: 04 Nov 2016 19:05
- Family Historian: V7
- Location: Oundle, Northamptonshire, England
- Contact:
Re: Sentence template formatting
I should have been clearer, this is my sentence template and the point is there is a space in front of {date}, which makes me think there could be a problem in the report itself. I haven't seen this on any other facts in these reports.
<para>{%CUR_PRIN.NAME[1]:FIRST%} married {spouse/her/him}<, {=CombineText(Sex(%CUR_PRIN2%,"son of ","daughter of "," ? of "), TextIf( Exists(%CUR_PRIN2.FAMC%), Text( CombineText(,%CUR_PRIN2.~FATH>%,,"unknown father") . " and " . CombineText(,%CUR_PRIN2.~MOTH>%,,"unknown mother")),""),"",)},>< on {%FACT.DATE:DAY_OF_WEEK%}>< {date}>< in {_place}>< {their ages}><, {inline-note}>
<para>{%CUR_PRIN.NAME[1]:FIRST%} married {spouse/her/him}<, {=CombineText(Sex(%CUR_PRIN2%,"son of ","daughter of "," ? of "), TextIf( Exists(%CUR_PRIN2.FAMC%), Text( CombineText(,%CUR_PRIN2.~FATH>%,,"unknown father") . " and " . CombineText(,%CUR_PRIN2.~MOTH>%,,"unknown mother")),""),"",)},>< on {%FACT.DATE:DAY_OF_WEEK%}>< {date}>< in {_place}>< {their ages}><, {inline-note}>
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Sentence template formatting
You have a point. With that Sentence Template, the Sentence in the Facts tab for a Marriage correctly inserts a space before the date, but in the Narrative Report it gets omitted.
I thought it may be caused by the slightly unusual formatting:
...< on {%FACT.DATE:DAY_OF_WEEK%}>< {date}>< in {_place}>< {their ages}><, {inline-note}>
which can be simplified to:
... <on {%FACT.DATE:DAY_OF_WEEK%}> {date} {place} {their ages}<, {inline-note}>
Any multiple spaces should get automatically reduced to one space, so the spaces between those codes don't matter.
However, that code change made no difference in the report, except that when there is a Note an extra space is inserted before the conditional comma.
So the missing space before the date in the report should be reported to CP as a fault.
I thought it may be caused by the slightly unusual formatting:
...< on {%FACT.DATE:DAY_OF_WEEK%}>< {date}>< in {_place}>< {their ages}><, {inline-note}>
which can be simplified to:
... <on {%FACT.DATE:DAY_OF_WEEK%}> {date} {place} {their ages}<, {inline-note}>
Any multiple spaces should get automatically reduced to one space, so the spaces between those codes don't matter.
However, that code change made no difference in the report, except that when there is a Note an extra space is inserted before the conditional comma.
So the missing space before the date in the report should be reported to CP as a fault.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- dewilkinson
- Superstar
- Posts: 280
- Joined: 04 Nov 2016 19:05
- Family Historian: V7
- Location: Oundle, Northamptonshire, England
- Contact:
Re: Sentence template formatting
Duly reported and a ticket created.
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Sentence template formatting
What I cannot get my head around is why the Facts tab Sentence box is different from the Narrative Report sentence.
BTW: The =FactSentence(...) function always matches the Sentence box.
Why don't they all use the same algorithm/coding to ensure a consistent sentence structure?
I know a few codes that refer to individuals can render as a pronoun in reports if their name has already been used.
But that does not prevent the same algorithm/coding from being used in all scenarios.
In the Sentence box, the name will not have been used 'earlier' so the pronoun will never be displayed.
In the Narrative Reports, some names are rendered in bold, and the spaces between sentences must be inserted, but the underpinning algorithm/coding surely can be the same as is used by the Sentence box.
There have been a number of errors reporting similar discrepancies and this is another one.
BTW: The =FactSentence(...) function always matches the Sentence box.
Why don't they all use the same algorithm/coding to ensure a consistent sentence structure?
I know a few codes that refer to individuals can render as a pronoun in reports if their name has already been used.
But that does not prevent the same algorithm/coding from being used in all scenarios.
In the Sentence box, the name will not have been used 'earlier' so the pronoun will never be displayed.
In the Narrative Reports, some names are rendered in bold, and the spaces between sentences must be inserted, but the underpinning algorithm/coding surely can be the same as is used by the Sentence box.
There have been a number of errors reporting similar discrepancies and this is another one.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- dewilkinson
- Superstar
- Posts: 280
- Joined: 04 Nov 2016 19:05
- Family Historian: V7
- Location: Oundle, Northamptonshire, England
- Contact:
Re: Sentence template formatting
CP have replicated this problem and it will be investigated. Must say that CP have looked into this amazingly quickly.
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them