* Variable abbreviation/truncation of place names - possible?

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
Peter Collier
Famous
Posts: 191
Joined: 04 Nov 2015 17:32
Family Historian: V7
Location: Worcestershire, UK

Variable abbreviation/truncation of place names - possible?

Post by Peter Collier » 23 Dec 2015 00:47

A question for a power user, I expect!

I am aware place names can be truncated at the first or second comma in narrative reports by setting them to short or medium rather than tidy/full. I have a slightly more complicated requirement.

Half my tree is American, because of my wife, so my place names all have four fields: town, county, state, and country.

The usual abbreviation for British places would be town + county, e.g. "Boston, Lincolnshire". American places however would usually be abbreviated to town + state, e.g. "Boston, Massachusetts", with the second (county) field skipped over.

Is there a way to parameterise a narrative report, so that places where the country is USA are reported as town + state, and places where the country is UK, Great Britain, England, Scotland, or Ireland are reported as town + county?

While we are in the realm of the near impossible: Is it possible to record county names in full in the place records, but have them appear in abbreviated form in reports? For example, I would like to be able to correctly record a place as "Bromsgrove, Worcestershire, , UK" or "Cleethorpes, North East Lincolnshire, , UK" but have these appear in reports as "Bromsgrove, Worcs." or "Cleethorpes, Lincs."
Peter Collier

Collier, Savory, Buckerfield, Edmonds, Low, Dungey, Lester, Chambers, Walshe, Moylan, Bradley, Connors, Udale, Wilson, Benfield, Downey

avatar
Gowermick
Megastar
Posts: 1630
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Re: Variable abbreviation/truncation of place names - possib

Post by Gowermick » 23 Dec 2015 11:12

Peter,

The property box for place, has two usable fields, 'Place:' and 'Standardised:'! If I read the help correctly, if 'Standardised:' field is blank, Geocoding acts on 'Place:' field. If not, then 'Standardised:' is used for Geocoding

My thoughts are that if you put the full US name in the 'Standardised:' field (for Geocoding), but then put a shortened version in the 'Place:' field for your reports, this may solve your problem, as it would appear that the 'Place:' field is used in reports.

No doubt mike will correct me if I'm wrong!
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com

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

Re: Variable abbreviation/truncation of place names - possib

Post by tatewise » 23 Dec 2015 11:29

Yes, that is a brilliant solution (I was looking at something much more complex).

The only caveat is that 'abbreviated' form would appear everywhere, such as in the Property Box, all Diagrams, and all Reports, not just in Narrative Reports.

If that was a problem, then there may be a workaround that uses %FACT.PLAC>STAN% instead of %FACT.PLAC% or place.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Peter Collier
Famous
Posts: 191
Joined: 04 Nov 2015 17:32
Family Historian: V7
Location: Worcestershire, UK

Re: Variable abbreviation/truncation of place names - possib

Post by Peter Collier » 23 Dec 2015 16:46

I have considered that option; it may be the only workable solution. The downside is you lose the ability to record historic place names if these are different, without resorting to multiple records.
Peter Collier

Collier, Savory, Buckerfield, Edmonds, Low, Dungey, Lester, Chambers, Walshe, Moylan, Bradley, Connors, Udale, Wilson, Benfield, Downey

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

Re: Variable abbreviation/truncation of place names - possib

Post by tatewise » 23 Dec 2015 17:57

The historic place names issue is generally more complex than that, especially in the UK, where the same place often has several different historic names.

However, one possilble solution you could use in the Place record is:
Place Name: Abbreviated name
Standardized: Geocoding modern name
Note: Any historic names

The other snag with this is that only the Abbreviated name appears in Tools > Work with Data > Places, etc.

There is another possible solution, but it involves a complex use of the functions:
=TextIf()
=TextPart()
=GetLabelledText()
and changing every Sentence Template in Tools > Fact Types.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Peter Collier
Famous
Posts: 191
Joined: 04 Nov 2015 17:32
Family Historian: V7
Location: Worcestershire, UK

Re: Variable abbreviation/truncation of place names - possib

Post by Peter Collier » 23 Dec 2015 19:49

How would you parse those functions to get the required output? I haven't really got into that much depth yet; I'm still barely scratching the surface with the software.
Peter Collier

Collier, Savory, Buckerfield, Edmonds, Low, Dungey, Lester, Chambers, Walshe, Moylan, Bradley, Connors, Udale, Wilson, Benfield, Downey

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

Re: Variable abbreviation/truncation of place names - possib

Post by tatewise » 23 Dec 2015 20:16

There is no easy answer to that, other than becoming a power user as you intimated in your original posting. But the syntax parsing is the comparatively easy bit. The tricky bit is working out the semantic structure. I could attempt it for you, if it really comes to that.

BTW: There is another arrangement of the Place record fields you could use:
Place Name: Historic three or four part name
Standardized: Geocoding modern name
Note: Notes...
Last Change Note > Note: Abbreviated two part name

This keeps all the conventional use of the main fields.
To access the Last Change Note > Note field use the All tab, right-click on place name and choose Miscellaneous > Add Last Change Notes, then right-click Add Last Change Notes and choose Add Note > Add Note to this Record, which can be repeated to add as many Notes as you like.

Then in Tools > Fact Types in every Fact's Sentence/Witness Template you would replace
{place}
with
< in {=TextIf( Exists(%FACT.PLAC>CHAN.NOTE2%), %FACT.PLAC>CHAN.NOTE2%, %FACT.PLAC%)}>
which effectively says if Last Change Note exists, then display that text, else display Place Name text, but if neither then omit the prefix word in.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
DavidNewton
Superstar
Posts: 462
Joined: 25 Mar 2014 11:46
Family Historian: V7

Re: Variable abbreviation/truncation of place names - possib

Post by DavidNewton » 23 Dec 2015 20:38

tatewise wrote: Last Change Note > Note: Abbreviated two part name
What an excellent idea, I have often wished to use standard abbreviations but not for everything. It is fairly simple to customize data entry and add a field in the Main tab of the Property box to expose at least one such note (or as many as you think you might need). Add a custom entry with data reference %_PLAC.CHAN.NOTE2[1]%

David

User avatar
jimlad68
Megastar
Posts: 911
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: Variable abbreviation/truncation of place names - possib

Post by jimlad68 » 24 Dec 2015 03:39

I'm not sure if this is relevant, but coming from it at a different angle and probably starting point.

One of the problems with places is it is nice to use them in different forms for different reports/ diagrams/ maps. I like to keep just one primary record (of anything) and copy it or amend it semi automatically. I also like to ensure data portability, but not everybody worries too much about that. So my scenario mentioned in other posts is (bear with me as it is the methodology that counts):

- Keep my FULL master place information in a well structured PLACe record.
(This for info only - for me I keep a modern place address that can be found by things like Google maps and if required have a standard Source record for historical changes or other relevant information)
- with a plugin I can then copy/amend/reduce the PLACe info to the ADDRess record and use it a to make my diagrams more concise, i.e. use ADDR instead of PLAC, or whatever other purpose is needed.
- this can also be manipulated with plugin Rearrange Address and Place Parts.

The problem of the above approach to reports is that I think it is possible to include/exclude ADDRess, but not PLACe. So:

The principle is still to keep 1 master place record. This could be in the PLACe, ADDRess, Standardized or note field. Not forgetting that I think PLACe can also have a note field. From there, a plugin could create whatever is required in the PLACe field, either with "copy certain parts" or a list of conversions.

These links may also help

Rearrange Address and Place Parts Plugin (12330)
To Move Address into Place Record - or Not (12946)

This is my plugin (borrowed from elsewhere and very much tailored to my setup):

Code: Select all

-- To abbreviate PLACe records into ADDRess fields
--
-- N.B. All ADDRess fields should be blank first (do query then delete ADDRess column, or use plugin with plugin Rearrange Address and Place Parts)

tblTypes = {'INDI','FAM'} -- Scan both Family and Individual Record Types
ptrItem = fhNewItemPtr()
ptrFact = fhNewItemPtr()

for intType, strType in ipairs(tblTypes) do
   ptrItem:MoveToFirstRecord(strType)
   while ptrItem:IsNotNull() do
      if fhGetTag(ptrItem) == 'PLAC' then               -- Search items until Place field found
         ptrFact:MoveToParentItem(ptrItem)
         if fhGetItemText(ptrFact,'~.ADDR') == '' then   -- Check Address is empty (OR FIRST DELETE ALL VIA QUERY)
            ptrAddr = fhCreateItem('ADDR',ptrFact,true)  -- Ensure field exists
            if ptrAddr:IsNotNull() then
--
-- what these lines below do
--1 ("^(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)","%1,%2,%3,%4,%5,%6,%7,%8") 
--    removes columns 9+10 where there are 10 columns in use.
--2 ("^(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)","%1,%2,%3,%4,%5,%6,%7,%8")  
--    removes column 9 where there are only 9 columns in use.
--3 onwards change from PLAC detail to ADDR
--
local strPLAC = fhGetItemText(ptrFact,'~.PLAC') -- REPEAT FROM PLACe TO ADDRess LINES AS REQUIRED

strPLAC = strPLAC:gsub("^(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)","%1,%2,%3,%4,%5,%6,%7,%8")
strPLAC = strPLAC:gsub("^(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)","%1,%2,%3,%4,%5,%6,%7,%8")

-- old, strPLAC = strPLAC:gsub("^(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)","%1,%2,%3,%4,%5,%6,%7,%8")
-- old, strPLAC = strPLAC:gsub("^(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)","%1,%2,%3,%4,%5,%6,%7,%8")

--strPLAC = strPLAC:gsub("^","")
strPLAC = strPLAC:gsub(", Tunley United Reformed Church",", Tunley URC")
strPLAC = strPLAC:gsub("South Africa, , Capetown, Victoria and Alfred Waterfront, The One and Only Hotel","SA, Capetown, 1+Only Hotel")
strPLAC = strPLAC:gsub("^Wales, , Powys, Montgomeryshire, Llandrinio","Wales, Powys, Llandrinio")
strPLAC = strPLAC:gsub("^USA, New York, New York, Manhattan, , East 68th Street, 525, New York Presbyterian_Weill Cornell Medical Center","USA, Manhattan, Weill Cornell Medical Center")
strPLAC = strPLAC:gsub("^USA, New York, New York, Manhattan, , 10th Avenue, 1000, St Luke's; Roosevelt Hospital","USA, Manhattan, Roosevelt Hospital")
strPLAC = strPLAC:gsub("USA, New Jersey, Essex, Livingston, , St Barnabas Medical Center","USA, nj, Essex, Livingston, St Barnabas MedCen")
strPLAC = strPLAC:gsub("^Australia, Northern Territory","AU, NorT")
strPLAC = strPLAC:gsub("^Australia, Queensland","AU, WestA")
strPLAC = strPLAC:gsub("^Australia, New South Wales,","AU,NSW")
strPLAC = strPLAC:gsub("^Australia, Western Australia","AU,QLD")
strPLAC = strPLAC:gsub("^Australia,","AU,")
strPLAC = strPLAC:gsub("^England, , Berkshire,","Berks,")
strPLAC = strPLAC:gsub("^England, , Berkshire","Berkshire")
strPLAC = strPLAC:gsub("^England, , Warwickshire, Birmingham","Birmingham")
strPLAC = strPLAC:gsub("^England, , Lancashire, Blackburn","Blackburn")
strPLAC = strPLAC:gsub("^England, , Lancashire, Blackpool","Blackpool")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Bolton","Bolton")
strPLAC = strPLAC:gsub("^England, , Bristol","Bristol")
strPLAC = strPLAC:gsub("^England, , Lancashire, Burnley","Burnley")
strPLAC = strPLAC:gsub("^England, , Lancashire, Bury","Bury")
strPLAC = strPLAC:gsub("^Canada, Alberta,","CA, AlB,")
strPLAC = strPLAC:gsub("^Canada, British Columbia,","CA, BC,")
strPLAC = strPLAC:gsub("^Canada, Nova Scotia,","CA, NS,")
strPLAC = strPLAC:gsub("^Canada, Ontario,","CA, ON,")
strPLAC = strPLAC:gsub("^Canada,","CA,")
strPLAC = strPLAC:gsub("^England, , Cambridgeshire, East Cambridgeshire,","Cambs,")
strPLAC = strPLAC:gsub("^England, , Cambridgeshire,","Cambs,")
strPLAC = strPLAC:gsub("^England, , Cambridgeshire","Cambridgeshire")
strPLAC = strPLAC:gsub("^Canada, West, , Camerasco (or Camerases)","Canada, West, , Camerasco (or Camerases)")
strPLAC = strPLAC:gsub("^Canada, West, , Osevego","Canada, West, , Osevego")
strPLAC = strPLAC:gsub("^England, , Cumberland, Carlisle","Carlisle")
strPLAC = strPLAC:gsub("^England, , Cheshire,","Chesh,")
strPLAC = strPLAC:gsub("^England, , Lancashire, Chorley, , Chorley Hospital","Chorley Hospital")
strPLAC = strPLAC:gsub("^England, , Lancashire, Chorley","Chorley")
strPLAC = strPLAC:gsub("^England, , Cornwall","Cornwall")
strPLAC = strPLAC:gsub("^England, , Cumbria, South Lakeland, Coniston","Cumbria, Coniston")
strPLAC = strPLAC:gsub("^England, , Cumbria","Cumbria")
strPLAC = strPLAC:gsub("^England, , Derbyshire, Derby","Derby")
strPLAC = strPLAC:gsub("^England, , Derbyshire","Derbys")
strPLAC = strPLAC:gsub("^England, , Devon","Devon")
strPLAC = strPLAC:gsub("^England, , Dorset","Dorset")
strPLAC = strPLAC:gsub("^England, , Durham","Durham")
strPLAC = strPLAC:gsub("^England, , Lancashire, West Lancashire,","Lancs,")
strPLAC = strPLAC:gsub("^England, , Lancashire, West Lancashire","Lancashire")
strPLAC = strPLAC:gsub("^England, , Essex","Essex")
strPLAC = strPLAC:gsub("^England, , Devon, Exeter","Exeter")
strPLAC = strPLAC:gsub("^England, , Hampshire","Hampshire")
strPLAC = strPLAC:gsub("^England, , Herefordshire","Herefordshire")
strPLAC = strPLAC:gsub("^England, , Hertfordshire","Hertfordshire")
strPLAC = strPLAC:gsub("^England, , Huntingdonshire","Huntingdonshire")
strPLAC = strPLAC:gsub("^England, , Kent","Kent")
strPLAC = strPLAC:gsub("^England, , Lancashire, Lancaster, , Hospital","Lancaster Hospital")
strPLAC = strPLAC:gsub("^England, , Lancashire, Liverpool","Liverpool")
strPLAC = strPLAC:gsub("^England, , Lancashire, Lancaster,","Lancaster,")
strPLAC = strPLAC:gsub("^England, , Lancashire, Lancaster","Lancaster")
strPLAC = strPLAC:gsub("^England, , West Yorkshire, Leeds","Leeds")
strPLAC = strPLAC:gsub("^England, , Leicestershire","Leicestershire")
strPLAC = strPLAC:gsub("^England, , Greater London","London")
strPLAC = strPLAC:gsub("^England, , London","London")
strPLAC = strPLAC:gsub("^England, , Merseyside","Merseyside")
strPLAC = strPLAC:gsub("^England, , Middlesex","Middlesex")
strPLAC = strPLAC:gsub("^England, , Tyne and Wear, Newcastle Upon Tyne","Newcastle Upon Tyne")
strPLAC = strPLAC:gsub("^England, , Northumberland","Northumberland")
strPLAC = strPLAC:gsub("^England, , Nottinghamshire","Notts")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Oldham","Oldham")
strPLAC = strPLAC:gsub("^England, , Lancashire, Ormskirk","Ormskirk")
strPLAC = strPLAC:gsub("^England, , Lancashire, Leyland, , Turpin Green Lane, Leyland Methodist Church,","Lancs, Leyland, Turpin Green Methodist Church")
strPLAC = strPLAC:gsub("^England, , Oxfordshire","Oxfordshire")
strPLAC = strPLAC:gsub("^England, , Devon, Plymouth","Plymouth")
strPLAC = strPLAC:gsub("^England, , Lancashire, Preston","Preston")
strPLAC = strPLAC:gsub("^England, , Lancashire, Rochdale","Rochdale")
strPLAC = strPLAC:gsub("^England, , Lancashire, Salford","Salford")
strPLAC = strPLAC:gsub("^England, , Shropshire,","Shrops,")
strPLAC = strPLAC:gsub("^England, , Lancashire, Skelmersdale","Skelmersdale")
strPLAC = strPLAC:gsub("^England, , Somerset","Somerset")
strPLAC = strPLAC:gsub("^England, , Lancashire, Southport","Southport")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, St Helens","St Helens")
strPLAC = strPLAC:gsub("^England, , Staffordshire,","Staffs,")
strPLAC = strPLAC:gsub("^England, , Staffordshire","Staffordshire")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Stockport","Stockport")
strPLAC = strPLAC:gsub("^England, , County Durham, Stockton on Tees","Stockton on Tees")
strPLAC = strPLAC:gsub("^England, , Suffolk","Suffolk")
strPLAC = strPLAC:gsub("^England, , Surrey","Surrey")
strPLAC = strPLAC:gsub("^England, , East Sussex","Sussex")
strPLAC = strPLAC:gsub("^England, , Sussex","Sussex")
strPLAC = strPLAC:gsub("^England, , Tyne and Wear","Tyne&Wear")
strPLAC = strPLAC:gsub("^USA, New York, New York","USA, New York")
strPLAC = strPLAC:gsub("^USA, New York, New York, Manhattan, , 10th Avenue, 1000, St Luke's; Roosevelt Hospital","USA, NY, Manhattan, Roosevelt Hospital")
strPLAC = strPLAC:gsub("^USA, New York, New York, Manhattan, , East 68th Street, 525, New York Presbyterian;Weill Cornell Medical Center, NY 10065","USA, NY, Manhattan, Weill Cornell Medical C")
strPLAC = strPLAC:gsub("^USA, New York, New York, The Bronx, Throgs Neck","USA, NY, The Bronx, Throgs Neck")
strPLAC = strPLAC:gsub("^England, , West Midlands","ENG, W Midlands")
strPLAC = strPLAC:gsub("^Wales, , Ceredigion","Wales, , Ceredigion")
strPLAC = strPLAC:gsub("^Wales, , Clwyd, Flintshire, Flint","Wales, , Clwyd, Flintshire, Flint")
strPLAC = strPLAC:gsub("^Wales, , Clwyd, Wrexham","Wales, , Clwyd, Wrexham")
strPLAC = strPLAC:gsub("^Wales, , Mid Glamorgan","Wales, , MGlaM,")
strPLAC = strPLAC:gsub("^Wales, , South Glamorgan, Cardiff","Wales, Cardiff")
strPLAC = strPLAC:gsub("^England, , Lancashire, Warrington","Warrington")
strPLAC = strPLAC:gsub("^England, , Warwickshire","Warwicks")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Wigan, , Frog Lane, 75, Frog Lane Public Assistance Institution {1930_1948}","Wigan, , Frog Lane, 75, Workhouse")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Wigan, Standish Lower Ground, Crooke","Wigan, Crooke")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Wigan, Lower Ince, Cemetery Road, Lower Ince Cemetery and Wigan Crematorium.*","Wigan, Lower Ince Crem")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Wigan, Standish Lower Ground","Wigan, Standish Lwr Grnd")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Wigan","Wigan")
strPLAC = strPLAC:gsub("^England, , West Midlands, Wolverhampton","Wolverhampton")
strPLAC = strPLAC:gsub("^England, , Worcestershire, Malvern Hills,","Worcs,")
strPLAC = strPLAC:gsub("^England, , Worcestershire, Wyre Forest,","Worcs,")
strPLAC = strPLAC:gsub("^England, , North Yorkshire,","Yorks, ")
strPLAC = strPLAC:gsub("^England, , South Yorkshire,","Yorks, ")
strPLAC = strPLAC:gsub("^England, , West Yorkshire, Calderdale,","Yorks, ")
strPLAC = strPLAC:gsub("^England, , West Yorkshire,","Yorks, ")
strPLAC = strPLAC:gsub("^England, , East Riding of Yorkshire,","Yorks, ")
strPLAC = strPLAC:gsub("^England, , Yorkshire","Yorkshire")
strPLAC = strPLAC:gsub("^England, , Lancashire,","Lancs,")
strPLAC = strPLAC:gsub("^England, , Lancashire","Lancashire")
strPLAC = strPLAC:gsub("^England, , Greater Manchester, Manchester","Manchester")
strPLAC = strPLAC:gsub("^England, , Greater Manchester","GtrMan")
strPLAC = strPLAC:gsub("^England,","ENG,")
strPLAC = strPLAC:gsub(", Registrar~Office or Attended",", Reg")
strPLAC = strPLAC:gsub("registration district","reg dist")
strPLAC = strPLAC:gsub(", , ",", ")
strPLAC = strPLAC:gsub(", , ",", ")
strPLAC = strPLAC:gsub(", , ",", ")
strPLAC = strPLAC:gsub(", , ",", ")
strPLAC = strPLAC:gsub("^, ","")
strPLAC = strPLAC:gsub(" $","")
strPLAC = strPLAC:gsub(",$","")

             isOK = fhSetValueAsText(ptrAddr,strPLAC)  -- Set Address as copy of Place
            end
         end
      end
      ptrItem:MoveNextSpecial()
   end
end

Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

Post Reply