gedcom.icn: Procedures for reading GEDCOM files

procedure gedload:         load GEDCOM data from file f
procedure gedwalk:         generate GEDCOM tree nodes in preorder
procedure gedsub:          find subrecords
procedure gedval:          find subrecord values
procedure gedref:          find referenced nodes
procedure gedfnf:          get first name first
procedure gedlnf:          get last name first
procedure gednmf:          format name
procedure geddate:         get canonical date
procedure gedyear:         get year
procedure gedfind:         find individual by name

link gedcom
March 25, 2002; Gregg M. Townsend
This file is in the public domain.

These procedures read and interpret GEDCOM files, a standard
format for genealogy databases.
____________________________________________________________

gedload(f) loads GEDCOM data from file f and returns a gedcom
record containing the following fields:
    tree        root of tree of gednode records
    id          table of labeled nodes, indexed by @ID@
    fam         list of FAM nodes (marriages)
    ind         list of INDI nodes (individuals)

The tree is composed of gednode records R containing these fields:
    level       level
    id          ID (label), including @...@ delimiters
    tag         tag
    data        data
    lnum        line number
    parent      parent node in tree
    ref         referenced node, if any
    sub         sub-entry list
    hcode       unique hashcode, if INDI node

gedwalk(tree) generates the nodes of the tree in preorder.

Three procedures find descendants of a node based on a sequence
of identifying tag strings:
    gedsub(R, tag...) generates subnodes specified by tag sequence
    gedval(R, tag...) generates data values of those subnodes
    gedref(R, tag...) generates nodes referenced by those subnodes

Three procedures extract a person's name from an INDI record:
    gedfnf(R)   produces "John Quincy Adams" form
    gedlnf(R)   produces "Adams, John Quincy" form
    gednmf(R,f) produces an arbitrary format, substituting
                prefix, firstname, lastname, suffix for
                "P", "F", "L", "S" (respectively) in f

geddate(R) finds the DATE subnode of a node and returns a string
of at least 12 characters in a standard form such as "11 Jul 1767"
or "abt 1810".  It is assumed that the input is in English.

gedyear(R) returns the year from the DATE subnode of a node.

gedfind(g,s) generates the individuals under gedcom record g
that are named by s, a string of whitespace-separated words.
gedfind() generates each INDI node for which every word of s
is matched by either a word of the individual's name or by
the birth year.  Matching is case-insensitive.

Source code | Program Library Page | Icon Home Page