Sentence Structure
The sentence structure (as constructed by the import process) is: {his/her} <birth was registered in the {=Section(%FACT.NOTE2%,1,"||")}> {place}, <when {his/her} mother's surname was recorded as> <"{role:SURNAME=mother}">.
This produces an output: His birth was registered in the June quarter of 1982, when his mother's surname was recorded as "HEBDON".
Which is well and good, until on another person and fact where the mother's name is not recorded so there is no "mother" witness; The sentence produces the output: His birth was registered in the June quarter of 1982, when his mother's surname was recorded as.
If I move the conditional chevrons: {his/her} <birth was registered in the {=Section(%FACT.NOTE2%,1,"||")}> {place}, <when {his/her} mother's surname was recorded as <"{role:SURNAME=mother}">>.
I get an output: His birth was registered in the June quarter of 1982, when his mother's surname was recorded as <"{role:SURNAME=mother}"> in other words the surname is not being translated.
How can I make the whole of the statement about the mother conditional on there being a mother?
Bob,
The < angle brackets > must always be in matched pairs enclosing the conditional text and including one optional item that defines the condition.
In this case, the optional item is {role:SURNAME=mother}.
So the code should be <when {his/her} mother's surname was recorded as "{role:SURNAME=mother}">
Look at some standard facts that have Fact Witness Roles to see how they are structured.
You might want to report the wrongly formatted Sentence Template to CP.
It is the > < brackets in the middle that are at fault.,
Bob,
Sorry, I’ve just realised that won’t work because there is also the item {his/her} inside the < brackets > and that is not allowed.
So you will have to change it to <when their mother's surname was recorded as "{role:SURNAME=mother}">
I think we may have discussed this kind of problem before.
It also probably explains why FH inserted > < to make the Template syntactically valid.
Sent: 06 December 2022 17:06
To: family-historian@groups.io
Subject: Re: [family-historian] Sentence Structure
Bob,
The < angle brackets > must always be in matched pairs enclosing the conditional text and including one optional item that defines the condition.
In this case, the optional item is {role:SURNAME=mother}.
So the code should be <when {his/her} mother's surname was recorded as "{role:SURNAME=mother}">
Look at some standard facts that have Fact Witness Roles to see how they are structured.
You might want to report the wrongly formatted Sentence Template to CP.
It is the > < brackets in the middle that are at fault.,
I understand that the chevon/angle/conditional brackets need to be in matched pairs, but I didn't realise that they could not be nested, nor did I realise that {his/her} was conditional.
I can happily live with "their" until I revise the "fact" properly after importing the full project
BobH
Bob
You could consider alternate sentences for male and female principals.
<male:><when his mother's surname was recorded as "{role:SURNAME=mother}"><female:><when her mother's surname was recorded as "{role:SURNAME=mother}">
I’ve migrated from TMG where you could have as many conditional roles in a sentence as needed and where the sentence would only output if all conditions were met. It’s a pity that this feature/ability is not part of FH.
Regards
Malcolm Perrins
Sydney Australia
From: <family-historian@groups.io> on behalf of Mike Tate <post@...>
Reply to: <family-historian@groups.io>
Date: Wednesday, 7 December 2022 at 4:06 am
To: <family-historian@groups.io>
Subject: Re: [family-historian] Sentence Structure
Bob,
The < angle brackets > must always be in matched pairs enclosing the conditional text and including one optional item that defines the condition.
In this case, the optional item is {role:SURNAME=mother}.
So the code should be <when {his/her} mother's surname was recorded as "{role:SURNAME=mother}">
Look at some standard facts that have Fact Witness Roles to see how they are structured.
You might want to report the wrongly formatted Sentence Template to CP.
It is the > < brackets in the middle that are at fault.,
Mike
I don't understand your suggestion that there is no way to test the gender of the principal.
I tried Malcolm's idea and constructed a sentence:
<male:><His birth was registered in the {%FACT.NOTE2%} in the {%PLACE%} when his mother's surname was recorded as "{role:SURNAME=mother}"><female:><Her birth was registered in the {%FACT.NOTE2%} in the {%PLACE%} when her mother's surname was recorded as "{role:SURNAME=mother}">
This did test successfully for male and female principals, entered the note correctly, but couldn't parse the place or the surname. It appears to me that you cannot have more than one pair of braces (curly brackets) inside a pair of conditional chevrons, is that right?
The other point I don't understand is why I had to write {%FACT.NOTE2%} when there is only one note associated with the fact. The “Sentence Template Codes” section of “Help” implies I only need enter {FACT} (which doesn’t work)
Bob
Bob,
Sorry, the <male:> and <female:> codes are quite new and I had overlooked them.
Yes, you can only have one {curly bracket} item within conditional chevrons.
That single {curly bracket} item governs the condition. If it produces text then the condition is true and the text enclosed in chevrons is displayed.
Unfortunately, even items such as {his/hers} that always produce text are treated as conditional.
You seem to have misunderstood some of the {curly bracket} options.
Valid data reference items would be {%FACT.NOTE2%} and {%FACT.PLAC%} for the local Note and Place fields.
FACT.NOTE2 does mean the 2nd Note it means the Fact local Note field as opposed to a linked Note Record which uses FACT.NOTE
Nowhere in the Help does it mention {FACT}.
However, the codes {inline-note} and {_place} would be far simpler equivalents.
Parts of your Sentence Template do not need to be inside chevrons because they are unconditional.
e.g. His birth was registered
You may wish to put small phrases inside chevrons conditional on {inline-note} and on {_place} in case they don’t have values.
e.g. < in the {inline-note}>< in the {_place}>
The phrases governed by the {role:SURNAME=mother} item must be inside chevrons.
e.g. < when his mother's surname was recorded as "{role:SURNAME=mother}">
So a working Sentence Template would be such as:
<male:>His birth was registered< in the {inline-note}>< in the {_place}>< when his mother's surname was recorded as "{role:SURNAME=mother}"><female:>Her birth was registered< in the {inline-note}>< in the {_place}>< when in her mother's surname was recorded as "{role:SURNAME=mother}">
You are right (of course) Help does not it mention {FACT}.. When I wrote " The “Sentence Template Codes” section of “Help” implies I only need enter {FACT} (which doesn’t work)" I meant to say "... I only need to enter {NOTE} (which doesn't work)"
Thank you again, I can see your suggestion working satisfactorily. I didn't think of using {inline-note} because the import process didn't use it.
Bob
Bob,
The Help does not mention {NOTE} either, which as you say does not work.
What it does specify is {note} (which does work, although it inserts a full-stop, so {inline-note} is better).
In this context lowercase and uppercase as well as spelling are crucial.
Codes such as {note} and {_place} must be lowercase.
Data refs such as {%FACT.NOTE2%} and {%FACT.PLAC%} must be uppercase.