Page 1 of 1

Sentence template formatting

Posted: 13 Dec 2022 09:43
by dewilkinson
Interestingly I see a reverse of this regarding marriages in narrative reports, is this a bug that needs reporting to CP?
Screenshot 2022-12-13 093933.jpg
Screenshot 2022-12-13 093933.jpg (227.44 KiB) Viewed 615 times

Re: Sentence template formatting

Posted: 13 Dec 2022 11:00
by tatewise
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.

Re: Sentence template formatting

Posted: 13 Dec 2022 11:56
by dewilkinson
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}>

Re: Sentence template formatting

Posted: 13 Dec 2022 12:43
by tatewise
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.

Re: Sentence template formatting

Posted: 13 Dec 2022 12:51
by dewilkinson
Duly reported and a ticket created.

Re: Sentence template formatting

Posted: 13 Dec 2022 15:27
by tatewise
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.

Re: Sentence template formatting

Posted: 13 Dec 2022 16:02
by dewilkinson
CP have replicated this problem and it will be investigated. Must say that CP have looked into this amazingly quickly.