elliotchance / gedcom

👪 A Go library and CLI tools for encoding, decoding, traversing, merging, comparing, querying and publishing GEDCOM files.
MIT License
94 stars 21 forks source link

Please add support for unofficial _MARNM tag #300

Closed sadkingbilly closed 4 years ago

sadkingbilly commented 4 years ago

Geni has two fields to describe individual's last name: "birth surname" and "last name". In order to express it in GEDCOM, they are using an unofficial _MARNM tag which is populated with "last name" from their record, while SURN is always populated with "birth surname" (if available). You can actually choose which one of those goes into the NAME field between the slashes, but there is currently no way to extract the value of _MARNM tag using the query language. I would appreciate having such functionality, as it would make much easier for me to run various analysis scripts.

elliotchance commented 4 years ago

Hi @sadkingbilly - I've added the function NodesWithTagPath (uses the function in the main gedcom package) to make accessing any tag or tag path. There are some examples in the patch (https://github.com/elliotchance/gedcom/pull/303). However, in your case, you might need something like this?

.Individuals | {name: .String, marnm: NodesWithTagPath("NAME", "_MARNM")}

Let me know if that solves it for you.