Page 1 of 1

Find Duplicate Names Plugin

Posted: 26 Sep 2019 06:29
by shoshk
Hi,

I need a way to generate a list of people who have duplicate names (the same name occurs more than once for the person).

It's a pretty easy plugin to write, but before I spend the time, I wanted to check if something like this already exists. I checked the Plugin Store and didn't see anything, but I could have missed it.

Thanks,
Shosh

Re: Find Duplicate Names Plugin

Posted: 26 Sep 2019 09:48
by Jane
Are you looking for Individual records which have multiple name fields? or multiple records with the same value for the name field?

Re: Find Duplicate Names Plugin

Posted: 26 Sep 2019 09:58
by tatewise
I imagine that Find Duplicate Individuals is totally unsuitable. Otherwise, there is nothing else that I am aware of.

I was also thinking along the same lines as Jane. What exactly are you looking for?
  1. Any single Individual record where its Primary/Alternate Name fields contain duplicates?
  2. Multiple Individual records that share the same Primary/Alternate Name field value?

Re: Find Duplicate Names Plugin

Posted: 26 Sep 2019 12:33
by shoshk
I am looking for 1) Any single Individual record where its Primary/Alternate Name fields contain duplicates.

I don't think it should be too difficult to write.

Shosh

Re: Find Duplicate Names Plugin

Posted: 26 Sep 2019 12:37
by Jane
If you don't have a lot of people with more that 3 or 4 alternate names you could simply use a query
Adding to the list if
name[1] = name[2]
or
name[1] = name[3]
etc

Re: Find Duplicate Names Plugin

Posted: 26 Sep 2019 12:44
by shoshk
We enter all names found in the records. And there are a lot of variations. So an individual could have quite a few alternate names. I have individuals with upwards of 10 names. That's an awful lot of permutations.

Shosh

Re: Find Duplicate Names Plugin

Posted: 26 Sep 2019 13:12
by tatewise
When writing the Plugin, don't overlook all the various Name subsidiary fields that need comparing.
e.g.
~.NAME = Name
~.NAME.NPFX = Name Prefix
~.NAME.NSFX = Name Suffix
~.NAME.NICK = Nickname
~.NAME._USED = Given Name Used
~.NAME.GIVN = Given Name
~.NAME.SPFX = Surname Prefix
~.NAME.SURN = Surname
The first five relate to the Names & Titles dialogue, and the last three are unlikely to be used.
There are also NOTE and SOUR subsidiary fields possible that need to be considered.

I suggest the easiest technique is to use what I call a dictionary table such as local dicName = { }.
First compose the FullName from all the component fields above for NAME[1].
Then test if dicName[FullName] then to see if an entry already exists and add record to list.
Otherwise, use dicName[FullName] = true to add entry to the dictionary.
Repeat for NAME[2] , NAME[3] , et seq.

Re: Find Duplicate Names Plugin

Posted: 26 Sep 2019 13:16
by shoshk
I think that the only field which is relevant for us is ¬.NAME.

We do not assign values to any of the sub-fields. Does FH assign values to GIVN and/or SURN?

Shosh

Re: Find Duplicate Names Plugin

Posted: 26 Sep 2019 13:23
by tatewise
No, FH does not perform any such 'hidden' assignments that some other products do.
Those subfields would only get assigned from imported GEDCOM or via the All tab.

Did you see my advice about NOTE and SOUR subfields, and how to use a dictionary table?