GEDCOM parser in JavaScript
Asked Answered
J

2

9

I have been looking for a GEDCOM parser in JavaScript. Does one exist at the moment? I have found them in many languages but not in JavaScript yet.

Jorum answered 26/1, 2013 at 21:57 Comment(1)
GEDCOM parsers are fairly simple to write. I've done a few over the years, including one in Javascript. The basic approach is to create an object for each individual, then add properties to that object for the various data, such a DOB etc. If you are adding something that has its own sub keys, then you can nest objects.Ubald
R
7
Rebutter answered 12/2, 2013 at 21:23 Comment(3)
i ended up writing my own. It really wasn't hard. its easy in JS since you can add elements to objects.Jorum
thanks for accepting ekaqu, if you share your code i would like to take a look so that i can compare with my Ruby code, it's never perfect isn't it ?Rebutter
I put it on github. There is a modification from normal to check if the tag's value contains an id. This is because Family Tree Legends seems to some times put id there, some times in the id part... i wasn't sure why but it helped me link things properly.Jorum
N
0

I believe you can use ANTLR, a library for parsing almost any language, with multiple target languages that include Javascript, Go, etc. It has a definition for GEDCOM already.

Nomarch answered 18/4 at 23:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.