~ubuntu-branches/ubuntu/trusty/lifelines/trusty

« back to all changes in this revision

Viewing changes to reports/givens_gender.ll

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Augusto van de Wiel (faw)
  • Date: 2007-05-23 23:49:53 UTC
  • mfrom: (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20070523234953-ogno9rnbmth61i7p
Tags: 3.0.50-2etch1
* Changing docs/ll-reportmanual.xml and docs/ll-userguide.xml to fix
  documentation build problems (Closes: #418347).

* lifelines-reports
  - Adding a dependency to lifelines >= 3.0.50 to prevent file conflict.
    (Closes: #405500).

* Updating French translation. Thanks to Bernard Adrian. (Closes: #356671).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * @progname       givens_gender.ll
 
3
 * @version        1
 
4
 * @author         Jim Eggert (eggertj@ll.mit.edu)
 
5
 * @category       
 
6
 * @output         Text
 
7
 * @description
 
8
 
 
9
Given name gender report program.
 
10
This program prints a list of all given names of people, tagged by one
 
11
of the following:
 
12
M  Only males
 
13
F  Only females
 
14
B  Males and females
 
15
M? Males and persons of unknown gender
 
16
F? Females and persons of unknown gender
 
17
B? Males, females, and persons of unknown gender
 
18
 
 
19
Very few names should be marked as B.  Check them carefully and you
 
20
may find some database gender errors.  You may be able to help resolve
 
21
unknown genders for those names tagged M? and F?.
 
22
 
 
23
If you want to sort the report by name only, do
 
24
  sort +1b -2b report > report.sort
 
25
If you want to sort the report by gender and name, do
 
26
  sort report > report.sort
 
27
 
 
28
If you want to find a person with a specific given name and gender,
 
29
use givens_gender_finder.
 
30
 
 
31
        by Jim Eggert (eggertj@ll.mit.edu)
 
32
        Version 1 (19 April 1995) requires LifeLines 3.0.1 or later.
 
33
*/
 
34
 
 
35
proc main() {
 
36
    table(namestable)
 
37
    list(nameslist)
 
38
    list(codelist)
 
39
    list(names)
 
40
    print("Collecting names...")
 
41
    set(namescount,0)
 
42
    forindi(person,pnum) {
 
43
/* if (gt(pnum,300)) { break() } */
 
44
        if (male(person)) { set(a,15) set(m,2) }
 
45
        elsif (female(person)) { set(a,10) set(m,3) }
 
46
        else { set(a,6) set(m,5) }
 
47
        extractnames(inode(person),names,nnames,isurname)
 
48
        forlist(names,name,iname) {
 
49
            if (ne(iname,isurname)) {
 
50
                if (l,lookup(namestable,name)) {
 
51
                    if (not(mod(l,m))) {
 
52
                        insert(namestable,save(name),add(l,a))
 
53
                    }
 
54
                }
 
55
                else {
 
56
                    set(sname,save(name))
 
57
                    insert(namestable,sname,a)
 
58
                    enqueue(nameslist,sname)
 
59
                    incr(namescount)
 
60
                }
 
61
            }
 
62
        }
 
63
    }
 
64
    setel(codelist, 6,"?  ")
 
65
    setel(codelist,10,"F  ")
 
66
    setel(codelist,15,"M  ")
 
67
    setel(codelist,16,"F? ")
 
68
    setel(codelist,21,"M? ")
 
69
    setel(codelist,25,"B  ")
 
70
    setel(codelist,31,"B? ")
 
71
    print("done\nPrinting ", d(namescount)," names...")
 
72
    while(name,dequeue(nameslist)) {
 
73
        getel(codelist,lookup(namestable,name))
 
74
        name "\n"
 
75
    }
 
76
}