* Configuring Places (containing Farm) in Sentence Templates
Configuring Places (containing Farm) in Sentence Templates
Hi
I have been trying to configure my sentence templates so they appear the way I want them to in Narrative reports. I thought it wouldn't take long, but after a many hours of research, reviewing the FHUG Forum, experimentation, fussiness and like everyone else, trying to settle on my Place/Address structure, I need to call for help.
My goal is to configure sentence templates so that Places that contain the word “Farm” are prefixed with “at” instead of “in”, but also ensure that “in” is used for all other Places (that do not contain the word "Farm"). I think I am very close using functions in the sentence template, but cannot figure out how to remove “in” when no place exists. Of course, I may learn that I have been barking up the wrong tree also! All and any advice welcome!
See below:
Background Info
- I am using FH6
- I have many Places that are Farms
- My address data is not duplicated in place data.
- My Places are loosely structured across 3 columns as follows: Farm/Village/Town – County – Country
- My Addresses are all stored in one column, which I simply use for house # and street, church name, cemetery name etc.
1. For all cases, I want to prefix ‘Address’ with ‘at’ (E.g. at 21 Main Street), which is simple enough using <at {address}>
2. Where a ‘Place’ contains the word “Farm”, I want to prefix it with “at” (e.g. at Broomfield Farm). This is because “in” does not sound correct when referencing farms. I do not want to move Farms from my Places to Addresses, as in many cases the next jurisdiction level is County and I want the Farm name to appear in Focus views within FH. (E.g. Broomfield Farm, Northumberland, England). Here is a Example of an indeal sentence containing "Farm" where all information is stored as Place data (IE no address data exists): “John Brown was born on June 2 1950 at Broomfield Farm in Northumberland, England"
3. Where a ‘Place’ does not contain the word “Farm”, prefix it with “in” (E.g. in Alnwick). Here is a non-Farm example of a sentence where 21 Main Street is captured as an Address: “John Brown was born on June 2 1950 at 21 Main Street in Alnwick, Northumberland, England”
4. Where ‘Place’ does not exist, ensure neither “in” or “at” is displayed. Here is an example of a sentence where no Place or Address information exists. Example: ”John Brown was born on June 2 1950”
I think I’m pretty close to achieving above, but cannot find a way to remove “in” when there is no place record. See below for the sentence template section that I created that pertains to how places and addresses are referenced:
<at {address}> {=TextIf(IsTrue(Exists(%FACT.PLAC%) and ContainsText(%FACT.PLAC>%,"Farm", STD)),"at", "in")} {_place}
This works for scenarios 1, 2 and 3 above, but not for scenario 4, where I am left with “in” at the end of the sentence. E.g. ”John Brown was born on June 2 1950 in”
Any help would be greatly appreciated. I am also open to any other methods to achieve the same end result. Happy to provide more info or anything I missed.
Many Thanks
Giles
I have been trying to configure my sentence templates so they appear the way I want them to in Narrative reports. I thought it wouldn't take long, but after a many hours of research, reviewing the FHUG Forum, experimentation, fussiness and like everyone else, trying to settle on my Place/Address structure, I need to call for help.
My goal is to configure sentence templates so that Places that contain the word “Farm” are prefixed with “at” instead of “in”, but also ensure that “in” is used for all other Places (that do not contain the word "Farm"). I think I am very close using functions in the sentence template, but cannot figure out how to remove “in” when no place exists. Of course, I may learn that I have been barking up the wrong tree also! All and any advice welcome!
See below:
Background Info
- I am using FH6
- I have many Places that are Farms
- My address data is not duplicated in place data.
- My Places are loosely structured across 3 columns as follows: Farm/Village/Town – County – Country
- My Addresses are all stored in one column, which I simply use for house # and street, church name, cemetery name etc.
1. For all cases, I want to prefix ‘Address’ with ‘at’ (E.g. at 21 Main Street), which is simple enough using <at {address}>
2. Where a ‘Place’ contains the word “Farm”, I want to prefix it with “at” (e.g. at Broomfield Farm). This is because “in” does not sound correct when referencing farms. I do not want to move Farms from my Places to Addresses, as in many cases the next jurisdiction level is County and I want the Farm name to appear in Focus views within FH. (E.g. Broomfield Farm, Northumberland, England). Here is a Example of an indeal sentence containing "Farm" where all information is stored as Place data (IE no address data exists): “John Brown was born on June 2 1950 at Broomfield Farm in Northumberland, England"
3. Where a ‘Place’ does not contain the word “Farm”, prefix it with “in” (E.g. in Alnwick). Here is a non-Farm example of a sentence where 21 Main Street is captured as an Address: “John Brown was born on June 2 1950 at 21 Main Street in Alnwick, Northumberland, England”
4. Where ‘Place’ does not exist, ensure neither “in” or “at” is displayed. Here is an example of a sentence where no Place or Address information exists. Example: ”John Brown was born on June 2 1950”
I think I’m pretty close to achieving above, but cannot find a way to remove “in” when there is no place record. See below for the sentence template section that I created that pertains to how places and addresses are referenced:
<at {address}> {=TextIf(IsTrue(Exists(%FACT.PLAC%) and ContainsText(%FACT.PLAC>%,"Farm", STD)),"at", "in")} {_place}
This works for scenarios 1, 2 and 3 above, but not for scenario 4, where I am left with “in” at the end of the sentence. E.g. ”John Brown was born on June 2 1950 in”
Any help would be greatly appreciated. I am also open to any other methods to achieve the same end result. Happy to provide more info or anything I missed.
Many Thanks
Giles
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Configuring Places (containing Farm) in Sentence Templat
As you have V6 you can use functions and expressions in Sentences. so you could use the containstext function to check for Farm and then output the text using if.
Something like this should work, it looks for " Farm," to try and avoid matching with Farmbrough or similar
{=TextIf(Exists(%FACT.PLAC>%),TextIf(ContainsText(%FACT.PLAC>%," Farm,",STD),"at","in"),)}
A good way to test functions like this is to use them on the query window first with a fact query as you can easily see lots of examples.
Something like this should work, it looks for " Farm," to try and avoid matching with Farmbrough or similar
{=TextIf(Exists(%FACT.PLAC>%),TextIf(ContainsText(%FACT.PLAC>%," Farm,",STD),"at","in"),)}
A good way to test functions like this is to use them on the query window first with a fact query as you can easily see lots of examples.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- AdrianBruce
- Megastar
- Posts: 1962
- Joined: 09 Aug 2003 21:02
- Family Historian: V7
- Location: South Cheshire
- Contact:
Re: Configuring Places (containing Farm) in Sentence Templat
Firstly let me thank Jane for the solution to deciding on "at" or "in" - when I get onto v6, I will have to try to apply this to my Military Service attribute because you serve on a ship but in a regiment / battalion / brigade. Although the criteria might be a bit more complex... And I need a definite article working in ("in the Cheshire Regiment") for the Army but not for the Navy or RAF ("on HMS Renown" or "in 633 Squadron") - oh heck. Still, that can wait.
I would say, Giles, that I do see issues with your approach to putting the farm name into the place.
Using "at" instead of "in", I totally agree with. Non-duplication across address and place - absolutely. My real concern is with "I do not want to move Farms from my Places to Addresses, as in many cases the next jurisdiction level is County" (as your structure is "Farm/Village/Town – County – Country" - and my italics). The example you quote is "Broomfield Farm, Northumberland, England". Now, while Google Maps finds a place of this name today quite easily, I have serious concerns over historic farm names. Unless you have access to a farm-level gazetteer for the appropriate period, I wonder what guarantee you have that there is only one Broomfield Farm in Northumberland at the time in question? And for anyone else reading your report, how do they decide where the Farm is, particularly if the name is no longer in use?
What I try to do is (as you probably guessed) put the farm name in the address and into the place I put the parish or, preferably, the township - thus (probably getting this wrong) I'd have an address of "Broomfield Farm" and a place of "Ryton parish, Northumberland, England" or even "Chopwell township, Northumberland, England" - if that's the right one. Finding the township is often not simple so you might care to substitute some other division.
However - what I confess this doesn't give is visibility in the Focus window - I think. So probably in the end it comes down to how much you value the exact farm name in the focus window - I have no opinion on that since I simply don't use it!
I would say, Giles, that I do see issues with your approach to putting the farm name into the place.
Using "at" instead of "in", I totally agree with. Non-duplication across address and place - absolutely. My real concern is with "I do not want to move Farms from my Places to Addresses, as in many cases the next jurisdiction level is County" (as your structure is "Farm/Village/Town – County – Country" - and my italics). The example you quote is "Broomfield Farm, Northumberland, England". Now, while Google Maps finds a place of this name today quite easily, I have serious concerns over historic farm names. Unless you have access to a farm-level gazetteer for the appropriate period, I wonder what guarantee you have that there is only one Broomfield Farm in Northumberland at the time in question? And for anyone else reading your report, how do they decide where the Farm is, particularly if the name is no longer in use?
What I try to do is (as you probably guessed) put the farm name in the address and into the place I put the parish or, preferably, the township - thus (probably getting this wrong) I'd have an address of "Broomfield Farm" and a place of "Ryton parish, Northumberland, England" or even "Chopwell township, Northumberland, England" - if that's the right one. Finding the township is often not simple so you might care to substitute some other division.
However - what I confess this doesn't give is visibility in the Focus window - I think. So probably in the end it comes down to how much you value the exact farm name in the focus window - I have no opinion on that since I simply don't use it!
Adrian
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Configuring Places (containing Farm) in Sentence Templat
Adrian, you forgot a wrinkle they might be Fleet Air Arm and serve at HMS Heron in 846 NAVAL AIR SQUADRON!
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
Re: Configuring Places (containing Farm) in Sentence Templat
Thank you very much for your help, Jane. The function that you provided works perfectly!
Thanks also, Adrian, for your advice. It is well taken! I think I will keep the Farm name in the Place field and also look to add Parish or close Town also. This way I can still see the Farm name in the Focus window, but also have the additional place info for reference. Now that the sentences read correctly in the Narrative reports, it has removed some of the constraints I was working under when using address vs place, mainly concerning how the reports handled 'Short form for repeated place names'.
Once again, thanks for the excellent support!
Thanks also, Adrian, for your advice. It is well taken! I think I will keep the Farm name in the Place field and also look to add Parish or close Town also. This way I can still see the Farm name in the Focus window, but also have the additional place info for reference. Now that the sentences read correctly in the Narrative reports, it has removed some of the constraints I was working under when using address vs place, mainly concerning how the reports handled 'Short form for repeated place names'.
Once again, thanks for the excellent support!
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Configuring Places (containing Farm) in Sentence Templat
If you add an extra Place part column to accommodate Farm and Parish/Town (i.e. 4 Columns) then you need to add a <blank> column to every other Place field. Otherwise, when you view Tools > Work with Data > Places you won't be able to usefully the Sort by Column, because your County and Country will not all be in the same Column.
So your new Place structure will be: Farm - Parish/Village/Town – County – Country
Don't think you can put the Farm and Parish/Town all in the same Column part without a comma in between.
If you do that then your newly crafted Sentence Template will not work because the text " Farm," will never exist!
So your new Place structure will be: Farm - Parish/Village/Town – County – Country
Don't think you can put the Farm and Parish/Town all in the same Column part without a comma in between.
If you do that then your newly crafted Sentence Template will not work because the text " Farm," will never exist!
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Configuring Places (containing Farm) in Sentence Templat
Thanks for the advice, Mike. For now, I was actually thinking of keeping the 3 columns, understanding that I lose the benefits (sorting etc.) of adding an additional column and having a structured regime. So in the case of where I have more than 3 columns worth of data I see that it simply groups the additional comma separated data into the 3rd column. E.g.
Col 1: Farm,
Col 2: Parish / Village / Town,
Col 3: County, Country
This works for me as far as I can tell. Maybe at some later stage I will add the extra column and go through the process of reorganizing my place data.
One side effect of the structured place part columns I have noticed is that where you need to add commas to represent no data in a column, these commas are also displayed in the ‘Born’ field in the Focus view and Individual Records view (E.g. “, Alnwick, Northumberland, England”) England. I guess it comes down to personal preference, but I wish they could be hidden (can they?). I realize they are hidden in the reports. It’s a very small niggle and outweighed when compared to the benefits of structuring the right amount of columns for sorting etc!
Cheers
Giles
Col 1: Farm,
Col 2: Parish / Village / Town,
Col 3: County, Country
This works for me as far as I can tell. Maybe at some later stage I will add the extra column and go through the process of reorganizing my place data.
One side effect of the structured place part columns I have noticed is that where you need to add commas to represent no data in a column, these commas are also displayed in the ‘Born’ field in the Focus view and Individual Records view (E.g. “, Alnwick, Northumberland, England”) England. I guess it comes down to personal preference, but I wish they could be hidden (can they?). I realize they are hidden in the reports. It’s a very small niggle and outweighed when compared to the benefits of structuring the right amount of columns for sorting etc!
Cheers
Giles
- AdrianBruce
- Megastar
- Posts: 1962
- Joined: 09 Aug 2003 21:02
- Family Historian: V7
- Location: South Cheshire
- Contact:
Re: Configuring Places (containing Farm) in Sentence Templat
Thank you Jane for that thought, and goodnight!Jane wrote:... they might be Fleet Air Arm and serve at HMS Heron in 846 NAVAL AIR SQUADRON!
Actually, joking aside, I can see why the "stone frigates" like HMS Heron get "at" - they are more like places. But I do have a stoker in my database who was allocated to "HMS Vivid II", a sort of organisation, when he wasn't on board ship. I wonder how he's been coded up in my database?
Adrian
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Configuring Places (containing Farm) in Sentence Templat
Giles, I agree it would be neater to hide the redundant commas in the Focus Window, but in the Property Box & Records Window they must be shown, otherwise how could you edit them?
An alternative you might like to consider is:
Col 1: "... Farm" Parish / Village / Town,
Col 2: County,
Col 3: Country
This keeps the three columns more or less intact, and by changing the Sentence Template to use ' Farm"' should still work.
Any variation on this scheme would work, such as Col 1: ... Farm in Parish / Village / Town, with " Farm in " within Template.
An alternative you might like to consider is:
Col 1: "... Farm" Parish / Village / Town,
Col 2: County,
Col 3: Country
This keeps the three columns more or less intact, and by changing the Sentence Template to use ' Farm"' should still work.
Any variation on this scheme would work, such as Col 1: ... Farm in Parish / Village / Town, with " Farm in " within Template.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Configuring Places (containing Farm) in Sentence Templat
Adrian,
I suppose that your ancestors, if submariners, might wish to be "in" their boat not "on" it, at least while submerged? And I do recall being told by a Commander RN that they serve "in" any ship or boat, not on it.....................! although to be fair, these days the "on" seems to be more commonly used, if not entirely correct
Cheers!
rocksrock
I suppose that your ancestors, if submariners, might wish to be "in" their boat not "on" it, at least while submerged? And I do recall being told by a Commander RN that they serve "in" any ship or boat, not on it.....................! although to be fair, these days the "on" seems to be more commonly used, if not entirely correct
Cheers!
rocksrock
Re: Configuring Places (containing Farm) in Sentence Templat
Thanks Mike. I wasn't sure why I referred to the records window regarding hiding commas! I really meant the Focus window. I now feel suitably humbled
You have presented some good options for me to consider. Thanks again for your valuable insights.
Giles
You have presented some good options for me to consider. Thanks again for your valuable insights.
Giles
- AdrianBruce
- Megastar
- Posts: 1962
- Joined: 09 Aug 2003 21:02
- Family Historian: V7
- Location: South Cheshire
- Contact:
Re: Configuring Places (containing Farm) in Sentence Templat
Hey - I'll take any excuse to get all 3 of the Army, RN and RAF as "in" - especially if it is actually probably pedantically correct. Yes, "he served in HMS Victory" - works for me, now that I think about it. Just leaves the issue of whether there's a "the" to appear in the sentence or not....rocksrock wrote:... And I do recall being told by a Commander RN that they serve "in" any ship or boat, not on it
Thanks for that.
Adrian