Moving titles from surnames to suffix

I have a few dozen persons, or maybe a bit more, who have titles like Lady or Lord, or King, in their surname, after the family name, or the clan’s, and I like to move these to the suffix, so that they don’t disturb the grouping my surname in my person view.

I can do this in C#, which I know better than Python, but I bet that it’s also possible with an Isotammi supertools script.

Has anyone ever tried such a script? Do we have an example somewhere that I can expand on?

What I mean is that for a name like Diana Spencer, Princess of Wales, I want to move the Princess part to the suffix. And sometimes there is a comma, which might make detection easier, but it’s not always there.

Using Gramps 5.1.6 on Linux Mint.

I utilize the alternate Display Name to put together the desired name format.

For something like royal titles I turn to Wikipedia to how their titles are formed. With English titles, their “surname” changes depending on their current title. William went from Cambridge to Wales when his father became king.

Interesting thought, and I’ll give that a try.

And titles change indeed, like for William.

Does this mean that you don’t register family names like Spencer or Mountbatten-Windsor?

I create multiple name entries as needed. From Birth to today. With this example, their most current name is slotted as the Preferred Name.

Wikipedia does not indicate a surname at William’s birth, just his four given names. I added Mountbatten-Windsor but that just might be my own cultural upbringing that people are born with full names. Of course, there is also the Royal House

Another site you might be interested in is The Peerage. Not sure how much non-English records it contains but Victoria married off her children all over Europe into other royal houses…

On The Peerage, and WikiTree too, descendants of the Queen and the Duke are listed as Mountbatten-Windsor, and that is the official name too, when needed:

Victoria’s children married all over the place indeed.

Last Sunday night, I hacked my C# Gramps XML Reader a bit, so that it moves all titles that appear after a comma in the surname to the suffix, and that works pretty fast. And the nice thing of writing that with Visual Studio Code, and running that in Linux, next to Gramps, is that I can immediately use the import & merge tool to compare its output to my current tree, and see whether I missed something.

My next step will be to check for words like King, Queen, Lord, Lady, etc. in the surname, and move those and the words after them to the suffix. That will also be an interactive procedure, so that I can immediately see what it does, without corrupting my tree.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.