File: places.ll

package info (click to toggle)
lifelines 3.0.50-2etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 11,160 kB
  • ctags: 6,517
  • sloc: ansic: 57,468; xml: 8,014; sh: 4,489; makefile: 848; yacc: 601; perl: 170; sed: 16
file content (153 lines) | stat: -rw-r--r-- 5,671 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
 * @progname       places.ll
 * @version        5.0
 * @author         Olsen, Eggert
 * @category       
 * @output         Text
 * @description    
 *
 * Prints out the value of all the lines in your database with the PLAC tag,
 * along with enough information so you can find the line easily. The purpose
 * of this report is so you can find all the places that seem wrong
 * (misspelled, ambiguous, incomplete [left out the county name], etc), and
 * double-check them or correct them. 

places

Version 1, 25 Nov 1992 by David Olsen (dko@cs.wisc.edu)
Version 2,  3 Dec 1992 by Jim Eggert (eggertj@atc.ll.mit.edu)
    (Changed numbers to real key values.)
Version 3,  5 Feb 1993 by David Olsen (dko@cs.wisc.edu)
    (Prints place names in reverse order.  Runs faster.)
Version 4, 13 Feb 1993 by Jim Eggert (eggertj@atc.ll.mit.edu)
    (Prints place names in regular or reverse order.)
Version 5,  1 Sep 1993 by Jim Eggert (eggertj@atc.ll.mit.edu)
    (Fixes a bug involving families with no parents)

Report program for LifeLines v. 2.3.3.

Prints out the value of all the lines in your database with the PLAC
tag, along with enough information so you can find the line easily.
The places are printed either exactly as they appear in the database
(e.g. Madison, Dane, Wisconsin) or in reverse order (e.g. Wisconsin,
Dane, Madison).  The purpose of this report is so you can find all the
places that seem wrong (mispelled, ambiguous, incomplete, etc.), and
double-check them or correct them.

The places are printed out in the order that they appear in the
database, so the report is not very useful in its native form.  To
make it more useful, run the output file through the program 'sort',
making it much easier to spot incorrect names.  For example, if you
have 100 entries within Middlesex County, Massachusetts, but in one of
them you mispelled Middlesex as Middlesx, it will be very easy to spot
this in the sorted output.

If the place name is part of an individual record, it is followed by
the key and name of the individual and by the hierarchy of tags
between the INDI tag and the PLAC tag (usually just a single tag, such
as BIRT or DEAT).  If the place name is part of a family record, it is
followed by the family key, the key and name of the husband (or wife
if there is no husband, or first child if there is no parent), the
relationship in the family of that person, and the hierarchy of tags
between the FAM tag and the PLAC tag (usually just the single tag
MARR).

Some sample output (in reverse order) that has already been sorted:

California, Los Angeles, Long Beach  | I130 Newel Knight YOUNG | DEAT
California, Los Angeles, Los Angeles  | I6811 Gunella CHRISTIANSEN | DEAT
California, Los Angeles, Newhall  | I836 Cena Elizabeth HAWKINS | DEAT
California, Los Angeles, San Fernando  | I836 Cena Elizabeth HAWKINS | BURI
California, Napa, Napa  | I1439 Cora Anna BEAL | DEAT
California, Riverside, Riverside  | F328 (I1370 Benjamin BERRY, husb) | MARR
California, San Bernadino,   | I6843 Emily LUDVIGSEN | BURI
California, San Bernadino, San Bernadino  | I1364 Francis LYTLE | DEAT
California, San Bernadino, San Bernadino  | I1365 Sophronia Jane MILLETT | DEAT
California, San Bernadino, San Bernadino  | I1367 Nancy Ellen LYTLE | BIRT
California, San Bernadino, San Bernadino  | I1369 Hulda Lorene LYTLE | BIRT
California, San Bernadino, San Bernadino  | I694 Mary Ann HENRY | BIRT
California, Shasta, Redding  | I1378 Eliza Lemira MILLETT | DEAT
California, Whittier, Rose Hills  | I2318 Zetta Fern MORTENSEN | BURI
Canada, Nova Scotia, Cape Breton  | F184 (I749 Ezra KING, husb) | MARR
Canada, Nova Scotia, Cape Breton  | I749 Ezra KING | DEAT


*/

proc main()
{
  list(tag_stack)
  list(place_names)

  set(reverse,0)
  getstrmsg(yesno,"Reverse place name components? (y/n)")
  if (strlen(yesno)) {
    if (not(strcmp(upper(trim(yesno,1)),"Y"))) { set(reverse,1) }
  }
  print("Printing all places.\n")
  print("Be patient.  This may take a while.\n")

  forindi (person, id) {

    traverse (inode(person), node, level) {

      setel(tag_stack, add(level, 1), tag(node))

      if (eq(strcmp(tag(node), "PLAC"), 0)) {
        extractplaces(node, place_names, num_places)
        if (reverse) {
          pop(place_names)
          while (p, pop(place_names)) { ", " p }
        }
        else {
          dequeue(place_names)
          while (p, dequeue(place_names)) { ", " p }
        }
        "  | " key(person) " " name(person) " |"
        forlist (tag_stack, tag, tag_number) {
          if (and(gt(tag_number, 1), le(tag_number, level))) { " " tag }
        }
        "\n"
      }
    }
  }

  forfam (fam, fnum) {

    traverse (fnode(fam), node, level) {
      setel(tag_stack, add(level, 1), tag(node))

      if (eq(strcmp(tag(node), "PLAC"), 0)) {
        extractplaces(node, place_names, num_places)
        if (reverse) {
          pop(place_names)
          while (p, pop(place_names)) { ", " p }
        }
        else {
          dequeue(place_names)
          while (p, dequeue(place_names)) { ", " p }
        }
        "  | " key(fam)
        " ("
        if (person,husband(fam)) { set(relation,", husb") }
        elsif (person,wife(fam)) { set(relation,", wife") }
        else {
          children(fam,child,cnum) {
            if (eq(cnum,1)) {
              set(person,child)
              set(relation,", chil")
            }
          }
        }
        if (person) {
          key(person) " " name(person) relation
        }
        ") |"
        forlist (tag_stack, tag, tag_number) {
          if (and(gt(tag_number, 1), le(tag_number, level))) { " " tag }
        }
        "\n"
      }
    }
  }
}