summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/pedigree-perl/Pedigree.pm
blob: c92a027b8651a3ecf1ac652a1a6d08c016afe2d7 (plain)
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
=pod

=head1 NAME

Pedigree - the main library for Pedigree.

=head1 SYNOPSIS

use Pedigree;

$node = Pedigree->MakeNode($params);

=head1 DESCRIPTION

This is the main package for pedigree construction.  It calls other
libraries in the Pedigree:: family

=over 4

=cut



####################################################################
# Define the package                                               #
####################################################################

package Pedigree;
use Pedigree::AbortionNode;
use Pedigree::Area;
use Pedigree::ChildlessNode;
use Pedigree::Language;
use Pedigree::MarriageNode;
use Pedigree::Node;
use Pedigree::Parser;
use Pedigree::PersonNode;
use Pedigree::TwinsNode;
use strict;

####################################################################
#    MakeNode                                                      #
####################################################################

=pod

=item B<MakeNode>(I<$params>);

Construct a new node from the given parameters.  Check what kind of node 
should we construct.

=cut

sub MakeNode {
    my ($class,$params)=@_;
    
    my $self;
    
    if ($params->{'Name'} =~ s/^\#//) {
	if ($params->{'Name'} eq 'abortion') {
	    $self=new Pedigree::AbortionNode(%{$params});
	} elsif ($params->{'Name'} eq 'childless') {
	    $self=new Pedigree::ChildlessNode(%{$params});
	} else {
	    print STDERR "Unknown special name: ", $params->{'Name'}, 
	    "\n";
	} 
    } else {
	$self=new Pedigree::PersonNode(%{$params});
    }
    return $self;

}




####################################################################
#    THE END                                                       #
####################################################################

=pod

=back

=head1 ENVIRONMENT

The calling program should define B<$main::DEBUG> and set it to 0
or 1.

=head1 SEE ALSO

pedigree(1), 
Pedigree::AbortionNode(3), 
Pedigree::Area(3), 
Pedigree::ChildlessNode(3),
Pedigree::Language(3), 
Pedigree::MarriageNode(3), 
Pedigree::Node(3), 
Pedigree::Parser(3), 
Pedigree::PersonNode(3),
Pedigree::TwinsNode(3),


=head1  AUTHOR

Boris Veytsman, Leila Akhmadeeva, 2007



=cut

1;