I have the Surname Case Convert plugin and it works great.
Except the family member who used all capitals for her surnames also used all capitals for the given names.
I suspect it might all comes down to this line:
strSurname = string.match(fhGetValueAsText(pName),"%b//")
I'm guessing the // is the Surname container? Not sure what the %b is doing.
So rather than converting the surname, I'd like to convert the given name.
I'm not really finding clues how to get the given name/s instead of the surname/s.
* Given Name Case Convert
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Given Name Case Convert
The "%b//" is an Lua Pattern as explained in plugins:understanding_lua_patterns|> Understanding Lua Patterns.
It is designed to recognise bracket pairs such as (...) or in this case /.../
Three lines in the Plugin need changing, and you have already found the first one.
Line 47 must match all leading characters except / to extract all forenames:
strSurname = string.match(fhGetValueAsText(pName),"%b//")
strSurname = string.match(fhGetValueAsText(pName),"^[^/]+")
Line 92 must not enclose name in /.../ pair:
tblSurname2['/'..line:upper()..'/'] = '/'..line..'/'
tblSurname2[line:upper()] = line
Line 102 is similar to line 47:
strName = string.gsub(oldname,"%b//",tblSurname2)
strName = string.gsub(oldname,"^[^/]+",tblSurname2)
Also every occurrence of Surname should be replaced by Forename throughout.
It may need further development to cater for Unicode UTF-8 accented letters.
In fact it needs a major overhaul, because instead of using those string.gsub() functions it can use NAME:SURNAME and NAME:GIVEN_ALL qualifiers, and a number of other features introduced since 2013.
It is designed to recognise bracket pairs such as (...) or in this case /.../
Three lines in the Plugin need changing, and you have already found the first one.
Line 47 must match all leading characters except / to extract all forenames:
strSurname = string.match(fhGetValueAsText(pName),"%b//")
strSurname = string.match(fhGetValueAsText(pName),"^[^/]+")
Line 92 must not enclose name in /.../ pair:
tblSurname2['/'..line:upper()..'/'] = '/'..line..'/'
tblSurname2[line:upper()] = line
Line 102 is similar to line 47:
strName = string.gsub(oldname,"%b//",tblSurname2)
strName = string.gsub(oldname,"^[^/]+",tblSurname2)
Also every occurrence of Surname should be replaced by Forename throughout.
It may need further development to cater for Unicode UTF-8 accented letters.
In fact it needs a major overhaul, because instead of using those string.gsub() functions it can use NAME:SURNAME and NAME:GIVEN_ALL qualifiers, and a number of other features introduced since 2013.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Given Name Case Convert
Thank you.
As I was researching some of the "language" on the internet, for things like fhGetValueAsText. It instead found GetValueAsText in the Unreal Engine documentation, a video game. Which apparently uses LUA like FH does.
I will look into the LUA Patterns page. (I programmed in Basic, Pascal, Fortran, and COBOL in college and my early days.)
The tweaks worked like a charm.
Again, thank you. (And thanks to Jane/Calico Pie for the helpful plugin in the first place.)
As I was researching some of the "language" on the internet, for things like fhGetValueAsText. It instead found GetValueAsText in the Unreal Engine documentation, a video game. Which apparently uses LUA like FH does.
I will look into the LUA Patterns page. (I programmed in Basic, Pascal, Fortran, and COBOL in college and my early days.)
The tweaks worked like a charm.
Again, thank you. (And thanks to Jane/Calico Pie for the helpful plugin in the first place.)
Last edited by stewartrb on 21 May 2016 13:14, edited 1 time in total.
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Given Name Case Convert
Yes Stewart, Lua is widely used, especially in the gaming community.
The Understanding Lua Patterns article is just one of several in plugins:index|> Family Historian Plugins under the Developer Guide that I strongly advise you study in depth.
The FH Tools > Plugins window also has extensive help under How to Write Plugins including all the API Functions such as fhGetValueAsText() and much more...
The Understanding Lua Patterns article is just one of several in plugins:index|> Family Historian Plugins under the Developer Guide that I strongly advise you study in depth.
The FH Tools > Plugins window also has extensive help under How to Write Plugins including all the API Functions such as fhGetValueAsText() and much more...
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry