File: nonpatronymics.ll

package info (click to toggle)
lifelines 3.0.50-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 11,140 kB
  • ctags: 6,517
  • sloc: ansic: 57,468; xml: 8,014; sh: 4,255; makefile: 848; yacc: 601; perl: 170; sed: 16
file content (57 lines) | stat: -rw-r--r-- 1,329 bytes parent folder | download | duplicates (5)
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
/*
 * @progname       nonpatronymics.ll
 * @version        1.0
 * @author         Eggert
 * @category       
 * @output         Text
 * @description    
 *
 *   Find all cases of nonpatronymic inheritances in the database.
 *   If the child's surname is not identical to the father's surname,
 *   print both out.  If the two surnames have different soundex
 *   codes, undent the printout.  Print statistics at the end.
 *
 *   nonpatronymics
 *
 *   Code by Jim Eggert, eggertj@ll.mit.edu
 *
 *   This report works only with the LifeLines Genealogy program
 *
 *   version one of this report was written by Jim Eggert, in 1992.
 *
 *   Output is an ASCII file.
 */

proc main ()
{
	set(n,0)
	set(ns,0)
	set(header,0)
	forindi(indi,num1) {
		if (fath,father(indi)) {
			if (ne(0,strcmp(surname(indi),surname(fath)))) {
				if (eq(header,0)) {
					"Dissimilar surnames" nl()
					"   Similar surnames" nl()
					set(header,1)
				}
				if (eq(strcmp(save(soundex(indi)),
					save(soundex(fath))),0)) {
					"   "
					set(ns,add(ns,1))
				}
				d(num1) " " name(indi)
				" <> "
				name(fath)
				nl()
				set(n,add(n,1))
			}
		}
	}
	nl() d(num1) " individuals scanned." nl()
	d(n) " nonpatronymic inheritances found"
	if (eq(n,0)) { "." nl() }
	else { "," nl()
		d(sub(n,ns)) " of which were soundex-dissimilar." nl()
	}
}