File Coverage

blib/lib/Genealogy/Gedcom/Reader/Lexer.pm
Criterion Covered Total %
statement 528 1305 40.4
branch 33 54 61.1
condition 11 17 64.7
subroutine 158 472 33.4
pod 10 175 5.7
total 740 2023 36.5


line stmt bran cond sub pod time code
1             package Genealogy::Gedcom::Reader::Lexer;
2              
3 1     1   1142 use strict;
  1         2  
  1         26  
4 1     1   5 use warnings;
  1         1  
  1         26  
5              
6 1     1   871 use Genealogy::Gedcom::Date;
  1         336515  
  1         9  
7              
8 1     1   40 use Log::Handler;
  1         3  
  1         10  
9              
10 1     1   22 use Moo;
  1         2  
  1         5  
11              
12 1     1   1095 use File::Slurper 'read_lines';
  1         2367  
  1         55  
13              
14 1     1   943 use Set::Array;
  1         18790  
  1         14  
15              
16 1     1   39 use Types::Standard qw/Any ArrayRef Int Str/;
  1         2  
  1         14  
17              
18             has counter =>
19             (
20             default => sub{return 0},
21             is => 'rw',
22             isa => Int,
23             required => 0,
24             );
25              
26             has gedcom_data =>
27             (
28             default => sub{return []},
29             is => 'rw',
30             isa => ArrayRef,
31             required => 0,
32             );
33              
34             has input_file =>
35             (
36             default => sub{return ''},
37             is => 'rw',
38             isa => Str,
39             required => 0,
40             );
41              
42             has items =>
43             (
44             default => sub{return Set::Array -> new},
45             is => 'rw',
46             isa => Any,
47             required => 0,
48             );
49              
50             has logger =>
51             (
52             default => sub{return undef},
53             is => 'rw',
54             isa => Any,
55             required => 0,
56             );
57              
58             has maxlevel =>
59             (
60             default => sub{return 'notice'},
61             is => 'rw',
62             isa => Str,
63             required => 0,
64             );
65              
66             has minlevel =>
67             (
68             default => sub{return 'error'},
69             is => 'rw',
70             isa => Str,
71             required => 0,
72             );
73              
74             has parser =>
75             (
76             default => sub{return Genealogy::Gedcom::Date -> new},
77             is => 'rw',
78             isa => Any,
79             required => 0,
80             );
81              
82             has report_items =>
83             (
84             default => sub{return 0},
85             is => 'rw',
86             isa => Int,
87             required => 0,
88             );
89              
90             has result =>
91             (
92             default => sub{return 0},
93             is => 'rw',
94             isa => Int,
95             required => 0,
96             );
97              
98             has strict =>
99             (
100             default => sub{return 0},
101             is => 'rw',
102             isa => Int,
103             required => 0,
104             );
105              
106             our $VERSION = '0.86';
107              
108             # --------------------------------------------------
109              
110             sub BUILD
111             {
112 7     7 0 406 my($self) = @_;
113              
114 7 50       209 if (! defined $self -> logger)
115             {
116 0         0 $self -> logger(Log::Handler -> new);
117 0         0 $self -> logger -> add
118             (
119             screen =>
120             {
121             maxlevel => $self -> maxlevel,
122             message_layout => '%m',
123             minlevel => $self -> minlevel,
124             utf8 => 1,
125             }
126             );
127             }
128              
129             } # End of BUILD.
130              
131             # --------------------------------------------------
132              
133             sub check_date
134             {
135 498     498 1 970 my($self, $id, $line) = @_;
136              
137 498 50       1634 if ($self -> check_length($id, $line) )
138             {
139 0         0 $self -> push_item($line, 'Invalid date');
140             }
141             else
142             {
143 498         11262 my($date) = $self -> parser -> parse(date => $$line[4]);
144              
145 498         11540614 $self -> log(debug => "$id: $date");
146 498 50       15243 $self -> push_item($line, $self -> parser -> error ? 'Invalid date' : 'Date');
147             }
148              
149             } # End of check_date.
150              
151             # --------------------------------------------------
152              
153             sub check_date_period
154             {
155 1     1 0 2 my($self, $id, $line) = @_;
156              
157 1 50       5 if ($self -> check_length($id, $line) )
158             {
159 0         0 $self -> push_item($line, 'Invalid date');
160             }
161             else
162             {
163 1         26 my($date) = $self -> parser -> parse(date => $$line[4]);
164              
165 1         26143 $self -> log(debug => "$id: $date");
166 1 50       33 $self -> push_item($line, $self -> parser -> error ? 'Invalid date' : 'Date');
167             }
168              
169             } # End of check_date_period.
170              
171             # --------------------------------------------------
172              
173             sub check_exact_date
174             {
175 255     255 0 592 my($self, $id, $line) = @_;
176              
177 255 50       782 if ($self -> check_length($id, $line) )
178             {
179 0         0 $self -> push_item($line, 'Invalid date');
180             }
181             else
182             {
183 255         5787 my($date) = $self -> parser -> parse(date => $$line[4]);
184              
185             # This is commented out because log has already been called by the caller.
186             # See also the previous 2 methods.
187              
188             #$self -> log(debug => "$id: $date");
189 255 50       4473580 $self -> push_item($line, $self -> parser -> error ? 'Invalid date' : 'Date');
190             }
191              
192             } # End of check_exact_date.
193              
194             # --------------------------------------------------
195              
196             sub check_length
197             {
198 1423     1423 1 2775 my($self, $id, $line) = @_;
199 1423         5346 $id =~ s/^tag_//;
200 1423         3607 my($value) = $$line[4];
201 1423         3703 my($length) = length($value);
202 1423         3682 my($min) = $self -> get_min_length($id, $line);
203 1423         12242 my($max) = $self -> get_max_length($id, $line);
204 1423 50 33     7645 my($result) = ( ($length < $min) || ($length > $max) ) ? 1 : 0;
205              
206 1423 50       3110 if ($result)
207             {
208 0         0 $self -> log(warning => "Line: $$line[0]. Field: $id. Value: $value. Length: $length. Valid length range $min .. $max");
209             }
210              
211             # Return 0 for success and 1 for failure.
212              
213 1423         4175 return $result;
214              
215             } # End of check_length.
216              
217             # --------------------------------------------------
218              
219             sub cross_check_xrefs
220             {
221 7     7 1 15 my($self) = @_;
222              
223 7         15 my(@link);
224             my(%target);
225              
226 7         13 for my $item (@{$self -> items})
  7         150  
227             {
228 3898 100       10230 if ($$item{type} =~ /^Link/)
229             {
230 788         2533 push @link, [$$item{data}, $$item{line_count}];
231             }
232              
233 3898 100 66     10611 if ( ($$item{level} == 0) && $$item{xref})
234             {
235 530 50       1304 if ($target{$$item{xref} })
236             {
237 0         0 $self -> log(warning => "Line $$item{line_count}. Xref $$item{xref} was also used on line $target{$$item{xref} }");
238             }
239              
240 530         1774 $target{$$item{xref} } = $$item{line_count};
241             }
242             }
243              
244 7         16 my(%seen);
245              
246 7         33 for my $link (@link)
247             {
248 788 100       2035 next if ($seen{$$link[0]});
249              
250 383 50       817 $self -> log(warning => "Line $$link[1]. Link $$link[0] does not point to an existing xref") if (! $target{$$link[0]});
251              
252 383         789 $seen{$$link[0]} = 1;
253             }
254              
255             } # End of cross_check_xrefs.
256              
257             # --------------------------------------------------
258              
259             sub get_gedcom_data_from_file
260             {
261 7     7 0 14 my($self) = @_;
262              
263 7         170 $self -> gedcom_data([map{s/^\s+//; s/\s+$//; $_} read_lines($self -> input_file)]);
  3914         12234349  
  3914         7669  
  3914         6808  
264              
265             } # End of get_gedcom_data_from_file.
266              
267             # --------------------------------------------------
268             # Source of max: Ged551-5.pdf.
269             # See also scripts/find.unused.limits.pl.
270              
271             sub get_max_length
272             {
273 1423     1423 1 2715 my($self, $id, $line) = @_;
274 1423         108109 my(%max) =
275             (
276             address_city => 60,
277             address_country => 60,
278             address_email => 120,
279             address_fax => 60,
280             address_line => 60,
281             address_line1 => 60,
282             address_line2 => 60,
283             address_line3 => 60,
284             address_postal_code => 10,
285             address_state => 60,
286             address_web_page => 120,
287             adopted_by_which_parent => 4,
288             age_at_event => 12,
289             ancestral_file_number => 12,
290             approved_system_id => 20,
291             attribute_descriptor => 90,
292             attribute_type => 4,
293             automated_record_id => 12,
294             caste_name => 90,
295             cause_of_event => 90,
296             certainty_assessment => 1,
297             change_date => 11,
298             character_set => 8,
299             child_linkage_status => 15,
300             copyright_gedcom_file => 90,
301             copyright_source_data => 90,
302             count_of_children => 3,
303             count_of_marriages => 3,
304             date => 35,
305             date_approximated => 35,
306             date_calendar => 35,
307             date_calendar_escape => 15,
308             date_exact => 11,
309             date_fren => 35,
310             date_greg => 35,
311             date_hebr => 35,
312             date_juln => 35,
313             date_lds_ord => 35,
314             date_period => 35,
315             date_phrase => 35,
316             date_range => 35,
317             date_value => 35,
318             day => 2,
319             descriptive_title => 248,
320             digit => 1,
321             entry_recording_date => 90,
322             event_attribute_type => 15,
323             event_descriptor => 90,
324             event_or_fact_classification => 90,
325             event_type_family => 4,
326             event_type_individual => 4,
327             events_recorded => 90,
328             file_name => 90,
329             gedcom_content_description => 248,
330             gedcom_form => 20,
331             generations_of_ancestors => 4,
332             generations_of_descendants => 4,
333             language_id => 15,
334             language_of_text => 15,
335             language_preference => 90,
336             lds_baptism_date_status => 10,
337             lds_child_sealing_date_status => 10,
338             lds_endowment_date_status => 10,
339             lds_spouse_sealing_date_status => 10,
340             multimedia_file_reference => 30,
341             multimedia_format => 4,
342             name_of_business => 90,
343             name_of_family_file => 120,
344             name_of_product => 90,
345             name_of_repository => 90,
346             name_of_source_data => 90,
347             name_personal => 120,
348             name_phonetic_variation => 120,
349             name_piece => 90,
350             name_piece_given => 120,
351             name_piece_nickname => 30,
352             name_piece_prefix => 30,
353             name_piece_suffix => 30,
354             name_piece_surname => 120,
355             name_piece_surname_prefix => 30,
356             name_romanized_variation => 120,
357             name_text => 120,
358             name_type => 30,
359             national_id_number => 30,
360             national_or_tribal_origin => 120,
361             new_tag => 15,
362             nobility_type_title => 120,
363             null => 0,
364             occupation => 90,
365             ordinance_process_flag => 3,
366             pedigree_linkage_type => 7,
367             permanent_record_file_number => 90,
368             phone_number => 25,
369             phonetic_type => 30,
370             physical_description => 248,
371             place_hierarchy => 120,
372             place_latitude => 8,
373             place_living_ordinance => 120,
374             place_longitude => 8,
375             place_name => 120,
376             place_phonetic_variation => 120,
377             place_romanized_variation => 120,
378             place_text => 120,
379             possessions => 248,
380             publication_date => 11,
381             receiving_system_name => 20,
382             record_identifier => 18,
383             registered_resource_identifier => 25,
384             relation_is_descriptor => 25,
385             religious_affiliation => 90,
386             responsible_agency => 120,
387             restriction_notice => 7,
388             role_descriptor => 25,
389             role_in_event => 15,
390             romanized_type => 30,
391             scholastic_achievement => 248,
392             sex_value => 7,
393             social_security_number => 11,
394             source_call_number => 120,
395             source_description => 248,
396             source_descriptive_title => 248,
397             source_filed_by_entry => 60,
398             source_jurisdiction_place => 120,
399             source_media_type => 15,
400             source_originator => 248,
401             source_publication_facts => 248,
402             submitter_name => 60,
403             submitter_registered_rfn => 30,
404             submitter_text => 248,
405             temple_code => 5,
406             text => 248,
407             text_from_source => 248,
408             time_value => 12,
409             transmission_date => 11,
410             user_reference_number => 20,
411             user_reference_type => 40,
412             version_number => 15,
413             where_within_source => 248,
414             year => 4,
415             year_greg => 7,
416             );
417              
418             # This dies rather than calls log(error...) because it's a coding error if $id is mis-spelt.
419              
420 1423   50     31348 return $max{$id} || die "Error: Line: $$line[0]. Invalid field name in get_max_length($id)";
421              
422             } # End of get_max_length.
423              
424             # --------------------------------------------------
425              
426             sub get_min_length
427             {
428 1423     1423 1 2548 my($self, $id, $line) = @_;
429              
430 1423         32142 return $self -> strict;
431              
432             } # End of get_min_length.
433              
434             # --------------------------------------------------
435              
436             sub get_sub_name
437             {
438 3898     3898 0 13399 my($self, @caller) = @_;
439              
440             # Remove package name prefix from sub name.
441              
442 3898         16657 $caller[3] =~ s/^.+:://;
443              
444 3898         13223 return $caller[3];
445              
446             } # End of get_sub_name.
447              
448             # --------------------------------------------------
449              
450             sub log
451             {
452 4397     4397 1 9554 my($self, $level, $s) = @_;
453              
454 4397 50       100244 $self -> logger -> $level($s) if ($self -> logger);
455              
456             } # End of log.
457              
458             # --------------------------------------------------
459              
460             sub push_item
461             {
462 3898     3898 1 30817 my($self, $line, $type) = @_;
463              
464 3898         82237 $self -> items -> push
465             (
466             {
467             count => $self -> counter($self -> counter + 1),
468             data => $$line[4],
469             level => $$line[1],
470             line_count => $$line[0],
471             tag => $$line[3],
472             type => $type,
473             xref => $$line[2],
474             }
475             );
476              
477             } # End of push_item.
478              
479             # -----------------------------------------------
480              
481             sub renumber_items
482             {
483 0     0 1 0 my($self) = @_;
484 0         0 my(@item) = @{$self -> items};
  0         0  
485              
486 0         0 my(@new);
487              
488 0         0 for my $i (0 .. $#item)
489             {
490 0         0 $item[$i]{count} = $i + 1;
491              
492 0         0 push @new, $item[$i];
493             }
494              
495 0         0 $self -> items(Set::Array -> new(@new) );
496              
497             } # End of renumber_items.
498              
499             # -----------------------------------------------
500              
501             sub report
502             {
503 0     0 1 0 my($self) = @_;
504 0         0 my($format) = '%6s %6s %6s %-6s %-6s %-12s %-s';
505              
506 0         0 $self -> log(info => sprintf($format, 'Count', 'Line', 'Level', 'Tag', 'Xref', 'Type', 'Data') );
507              
508 0         0 my(%type);
509              
510 0         0 for my $item ($self -> items -> print)
511             {
512 0         0 $type{$$item{type} } = 1;
513              
514 0         0 $self -> log(info => sprintf($format, $$item{count}, $$item{line_count}, $$item{level}, $$item{tag}, $$item{xref}, $$item{type}, $$item{data}) );
515             }
516              
517             } # End of report.
518              
519             # --------------------------------------------------
520              
521             sub run
522             {
523 7     7 1 1006 my($self) = @_;
524              
525 7 50       147 if ($self -> input_file)
526             {
527 7         698 $self -> get_gedcom_data_from_file;
528             }
529             else
530             {
531 0         0 my($lines) = $self -> gedcom_data;
532              
533 0 0       0 die 'Error: You must provide a GEDCOM file with -input_file, or data with gedcom_data([...])' if ($#$lines < 0);
534             }
535              
536 7         1470 my($line) = [];
537 7         34 my($line_count) = 0;
538 7         29 my($result) = 0; # Default to success.
539              
540 7         23 for my $record (@{$self -> gedcom_data})
  7         519  
541             {
542 3914         4743 $line_count++;
543              
544 3914 100       9562 next if ($record =~ /^$/);
545              
546             # Arrayref elements:
547             # 0: Input file line count.
548             # 1: Level.
549             # 2: Record id to be used as the target of a xref.
550             # 3: Tag.
551             # 4: Data belonging to tag.
552             # 5: Type (Item/Child of item) of record.
553             # 6: Input record.
554              
555 3898 100       22156 if ($record =~ /^(0)\s+\@(.+?)\@\s+(_?(?:[A-Z]{3,4}))\s*(.*)$/)
    100          
    50          
556             {
557 530 50       3071 push @$line, [$line_count, $1, defined($2) ? $2 : '', $3, defined($4) ? $4 : '', $record];
    50          
558             }
559             elsif ($record =~ /^(0)\s+(HEAD|TRLR)$/)
560             {
561 14         147 push @$line, [$line_count, $1, '', $2, '', $record];
562             }
563             elsif ($record =~ /^(\d+)\s+(_?(?:ADR[123]|[A-Z]{3,5}))\s*\@?(.*?)\@?$/)
564             {
565 3354 50       16520 push @$line, [$line_count, $1, '', $2, defined($3) ? $3 : '', $record];
566             }
567             else
568             {
569 0         0 die "Error: Line: $line_count. Invalid GEDCOM syntax in '$record'";
570             }
571             }
572              
573 7         68 $self -> tag_lineage(0, $line);
574 7 50       180 $self -> report if ($self -> report_items);
575 7         959 $self -> cross_check_xrefs;
576              
577             # Return 0 for success and 1 for failure.
578              
579 7         2976 return $result;
580              
581             } # End of run.
582              
583             # --------------------------------------------------
584              
585             sub tag_address_city
586             {
587 2     2 0 4 my($self, $index, $line) = @_;
588 2         16 my($id) = $self -> get_sub_name(caller 0);
589              
590 2         17 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
591 2         20 $self -> check_length($id, $$line[$index]);
592 2         8 $self -> push_item($$line[$index], 'Address');
593              
594 2         243 return ++$index;
595              
596             } # End of tag_address_city.
597              
598             # --------------------------------------------------
599              
600             sub tag_address_country
601             {
602 6     6 0 16 my($self, $index, $line) = @_;
603 6         62 my($id) = $self -> get_sub_name(caller 0);
604              
605 6         56 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
606 6         71 $self -> check_length($id, $$line[$index]);
607 6         29 $self -> push_item($$line[$index], 'Address');
608              
609 6         1142 return ++$index;
610              
611             } # End of tag_address_country.
612              
613             # --------------------------------------------------
614              
615             sub tag_address_email
616             {
617 6     6 0 19 my($self, $index, $line) = @_;
618 6         71 my($id) = $self -> get_sub_name(caller 0);
619              
620 6         65 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
621 6         76 $self -> check_length($id, $$line[$index]);
622 6         28 $self -> push_item($$line[$index], 'Address');
623              
624 6         955 return ++$index;
625              
626             } # End of tag_address_email.
627              
628             # --------------------------------------------------
629              
630             sub tag_address_fax
631             {
632 2     2 0 5 my($self, $index, $line) = @_;
633 2         16 my($id) = $self -> get_sub_name(caller 0);
634              
635 2         14 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
636 2         19 $self -> check_length($id, $$line[$index]);
637 2         7 $self -> push_item($$line[$index], 'Address');
638              
639 2         226 return ++$index;
640              
641             } # End of tag_address_fax.
642              
643             # --------------------------------------------------
644              
645             sub tag_address_line
646             {
647 6     6 0 19 my($self, $index, $line) = @_;
648 6         75 my($id) = $self -> get_sub_name(caller 0);
649              
650 6         57 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
651 6         74 $self -> check_length($id, $$line[$index]);
652 6         24 $self -> push_item($$line[$index], 'Address');
653              
654             return $self -> tag_advance
655             (
656             $id,
657             ++$index,
658             $line,
659             {
660 2     2   11 ADR1 => sub{return $self -> tag_address_line1(shift, shift)},
661 2     2   12 ADR2 => sub{return $self -> tag_address_line2(shift, shift)},
662 2     2   12 ADR3 => sub{return $self -> tag_address_line3(shift, shift)},
663 2     2   13 CITY => sub{return $self -> tag_address_city(shift, shift)},
664 2     2   12 CONT => sub{return $self -> tag_continue(shift, shift)},
665 6     6   40 CTRY => sub{return $self -> tag_address_country(shift, shift)},
666 6     6   37 POST => sub{return $self -> tag_address_postal_code(shift, shift)},
667 6     6   43 STAE => sub{return $self -> tag_address_state(shift, shift)},
668             }
669 6         1066 );
670              
671             } # End of tag_address_line.
672              
673             # --------------------------------------------------
674              
675             sub tag_address_line1
676             {
677 2     2 0 4 my($self, $index, $line) = @_;
678 2         16 my($id) = $self -> get_sub_name(caller 0);
679              
680 2         18 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
681 2         17 $self -> check_length($id, $$line[$index]);
682 2         7 $self -> push_item($$line[$index], 'Address');
683              
684 2         225 return ++$index;
685              
686             } # End of tag_address_line1.
687              
688             # --------------------------------------------------
689              
690             sub tag_address_line2
691             {
692 2     2 0 6 my($self, $index, $line) = @_;
693 2         19 my($id) = $self -> get_sub_name(caller 0);
694              
695 2         15 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
696 2         20 $self -> check_length($id, $$line[$index]);
697 2         8 $self -> push_item($$line[$index], 'Address');
698              
699 2         258 return ++$index;
700              
701             } # End of tag_address_line2.
702              
703             # --------------------------------------------------
704              
705             sub tag_address_line3
706             {
707 2     2 0 6 my($self, $index, $line) = @_;
708 2         17 my($id) = $self -> get_sub_name(caller 0);
709              
710 2         15 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
711 2         21 $self -> check_length($id, $$line[$index]);
712 2         7 $self -> push_item($$line[$index], 'Address');
713              
714 2         231 return ++$index;
715              
716             } # End of tag_address_line3.
717              
718             # --------------------------------------------------
719              
720             sub tag_address_postal_code
721             {
722 6     6 0 18 my($self, $index, $line) = @_;
723 6         66 my($id) = $self -> get_sub_name(caller 0);
724              
725 6         54 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
726 6         78 $self -> check_length($id, $$line[$index]);
727 6         27 $self -> push_item($$line[$index], 'Address');
728              
729 6         912 return ++$index;
730              
731             } # End of tag_address_postal_code.
732              
733             # --------------------------------------------------
734              
735             sub tag_address_state
736             {
737 6     6 0 16 my($self, $index, $line) = @_;
738 6         69 my($id) = $self -> get_sub_name(caller 0);
739              
740 6         99 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
741 6         71 $self -> check_length($id, $$line[$index]);
742 6         26 $self -> push_item($$line[$index], 'Address');
743              
744 6         969 return ++$index;
745              
746             } # End of tag_address_state.
747              
748             # --------------------------------------------------
749              
750             sub tag_address_structure
751             {
752 0     0 0 0 my($self, $index, $line) = @_;
753 0         0 my($id) = $self -> get_sub_name(caller 0);
754              
755 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
756 0         0 $self -> check_length($index, 'address_line', $$line[$index][4]);
757 0         0 $self -> push_item($$line[$index], 'Address structure');
758              
759             # Special case: $index, not ++$index. We're assumed to be already printing at the tag ADDR.
760              
761 0         0 return $self -> tag_advance
762             (
763             $id,
764             ++$index,
765             $line,
766             {
767             $self -> tag_address_structure_tags(),
768             }
769             );
770              
771             } # End of tag_address_structure.
772              
773             # --------------------------------------------------
774              
775             sub tag_address_structure_tags
776             {
777 509     509 0 1059 my($self) = @_;
778              
779             return
780             (
781 6     6   43 ADDR => sub{return $self -> tag_address_line(shift, shift)},
782 6     6   35 EMAIL => sub{return $self -> tag_address_email(shift, shift)},
783 2     2   10 FAX => sub{return $self -> tag_address_fax(shift, shift)},
784 2     2   12 PHON => sub{return $self -> tag_phone_number(shift, shift)},
785 8     8   44 WWW => sub{return $self -> tag_address_web_page(shift, shift)},
786 509         10961 );
787              
788             } # End of tag_address_structure_tags.
789              
790             # --------------------------------------------------
791              
792             sub tag_address_web_page
793             {
794 8     8 0 25 my($self, $index, $line) = @_;
795 8         102 my($id) = $self -> get_sub_name(caller 0);
796              
797 8         84 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
798 8         105 $self -> check_length($id, $$line[$index]);
799 8         36 $self -> push_item($$line[$index], 'Address');
800              
801 8         1550 return ++$index;
802              
803             } # End of tag_address_web_page.
804              
805             # --------------------------------------------------
806              
807             sub tag_advance
808             {
809 2406     2406 0 5094 my($self, $id, $index, $line, $jump) = @_;
810 2406         5900 my($level) = $$line[$index][1];
811 2406         4205 my($tag) = $$line[$index][3];
812              
813 2406   66     22646 while ( ($index <= $#$line) && ($$line[$index][1] >= $level) && ($$jump{$$line[$index][3]} || ($$line[$index][3] =~ /^_/) ) )
      100        
      66        
814             {
815 3884 100       11134 if ($$jump{$$line[$index][3]})
816             {
817 3877         12357 $index = $$jump{$$line[$index][3]} -> ($index, $line);
818             }
819             else
820             {
821 7         21 $self -> push_item($$line[$index], 'User');
822              
823 7         864 $index++;
824             }
825             }
826              
827 2406         79021 return $index;
828              
829             } # End of tag_advance.
830              
831             # --------------------------------------------------
832              
833             sub tag_age_at_event
834             {
835 1     1 0 4 my($self, $index, $line) = @_;
836 1         15 my($id) = $self -> get_sub_name(caller 0);
837              
838 1         9 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
839 1         11 $self -> check_length($id, $$line[$index]);
840 1         4 $self -> push_item($$line[$index], 'Individual');
841              
842 1         119 return ++$index;
843              
844             } # End of tag_age_at_event.
845              
846             # --------------------------------------------------
847              
848             sub tag_alias_xref
849             {
850 0     0 0 0 my($self, $index, $line) = @_;
851 0         0 my($id) = $self -> get_sub_name(caller 0);
852              
853 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
854 0         0 $self -> push_item($$line[$index], 'Link to INDI');
855              
856 0         0 return ++$index;
857              
858             } # End of tag_alias_xref.
859              
860             # --------------------------------------------------
861              
862             sub tag_ancestral_file_number
863             {
864 0     0 0 0 my($self, $index, $line) = @_;
865 0         0 my($id) = $self -> get_sub_name(caller 0);
866              
867 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
868 0         0 $self -> check_length($id, $$line[$index]);
869 0         0 $self -> push_item($$line[$index], '');
870              
871 0         0 return ++$index;
872              
873             } # End of tag_ancestral_file_number.
874              
875             # --------------------------------------------------
876              
877             sub tag_approved_system_id
878             {
879 7     7 0 25 my($self, $index, $line) = @_;
880 7         97 my($id) = $self -> get_sub_name(caller 0);
881              
882 7         75 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
883 7         120 $self -> check_length($id, $$line[$index]);
884 7         34 $self -> push_item($$line[$index], '');
885              
886             return $self -> tag_advance
887             (
888             $id,
889             ++$index,
890             $line,
891             {
892 6     6   46 CORP => sub{return $self -> tag_name_of_business(shift, shift)},
893 5     5   35 DATA => sub{return $self -> tag_name_of_source_data(shift, shift)},
894 7     7   54 NAME => sub{return $self -> tag_name_of_product(shift, shift)},
895 7     7   45 VERS => sub{return $self -> tag_version_number(shift, shift)},
896             }
897 7         1489 );
898              
899             } # End of tag_approved_system_id.
900              
901             # --------------------------------------------------
902              
903             sub tag_association_structure
904             {
905 0     0 0 0 my($self, $index, $line) = @_;
906 0         0 my($id) = $self -> get_sub_name(caller 0);
907              
908 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
909 0         0 $self -> push_item($$line[$index], 'Individual');
910              
911             return $self -> tag_advance
912             (
913             $id,
914             ++$index,
915             $line,
916             {
917 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
918 0     0   0 RELA => sub{return $self -> tag_relation_is_descriptor(shift, shift)},
919 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
920             }
921 0         0 );
922              
923             } # End of tag_association_structure.
924              
925             # --------------------------------------------------
926              
927             sub tag_automated_record_id
928             {
929 1     1 0 2 my($self, $index, $line) = @_;
930 1         15 my($id) = $self -> get_sub_name(caller 0);
931              
932 1         9 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
933 1         12 $self -> check_length($id, $$line[$index]);
934 1         5 $self -> push_item($$line[$index], '');
935              
936 1         139 return ++$index;
937              
938             } # End of tag_automated_record_id.
939              
940             # --------------------------------------------------
941              
942             sub tag_bapl_conl
943             {
944 0     0 0 0 my($self, $index, $line) = @_;
945 0         0 my($id) = $self -> get_sub_name(caller 0);
946              
947 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
948 0         0 $self -> push_item($$line[$index], 'Individual');
949              
950             return $self -> tag_advance
951             (
952             $id,
953             ++$index,
954             $line,
955             {
956 0     0   0 DATE => sub{return $self -> tag_date_lds_ord(shift, shift)},
957 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
958 0     0   0 PLAC => sub{return $self -> tag_place_living_ordinance(shift, shift)},
959 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
960 0     0   0 STAT => sub{return $self -> tag_lds_baptism_date_status(shift, shift)},
961 0     0   0 TEMP => sub{return $self -> tag_temple_code(shift, shift)},
962             }
963 0         0 );
964              
965             } # End of tag_bapl_conl.
966              
967             # --------------------------------------------------
968              
969             sub tag_caste_name
970             {
971 0     0 0 0 my($self, $index, $line) = @_;
972 0         0 my($id) = $self -> get_sub_name(caller 0);
973              
974 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
975 0         0 $self -> check_length($id, $$line[$index]);
976 0         0 $self -> push_item($$line[$index], 'Individual');
977              
978             return $self -> tag_advance
979             (
980             $id,
981             +$index,
982             $line,
983             {
984 0     0   0 DATE => sub{return $self -> tag_change_date1(shift, shift)},
985 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
986             }
987 0         0 );
988              
989             } # End of tag_caste_name.
990              
991             # --------------------------------------------------
992              
993             sub tag_cause_of_event
994             {
995 0     0 0 0 my($self, $index, $line) = @_;
996 0         0 my($id) = $self -> get_sub_name(caller 0);
997              
998 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
999 0         0 $self -> check_length($id, $$line[$index]);
1000 0         0 $self -> push_item($$line[$index], 'Event');
1001              
1002 0         0 return ++$index;
1003              
1004             } # End of tag_cause_of_event.
1005              
1006             # --------------------------------------------------
1007              
1008             sub tag_certainty_assessment
1009             {
1010 0     0 0 0 my($self, $index, $line) = @_;
1011 0         0 my($id) = $self -> get_sub_name(caller 0);
1012              
1013 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1014 0         0 $self -> check_length($id, $$line[$index]);
1015 0         0 $self -> push_item($$line[$index], 'Source');
1016              
1017 0         0 return ++$index;
1018              
1019             } # End of tag_certainty_assessment.
1020              
1021             # --------------------------------------------------
1022              
1023             sub tag_change_date
1024             {
1025 247     247 0 495 my($self, $index, $line) = @_;
1026 247         1883 my($id) = $self -> get_sub_name(caller 0);
1027              
1028 247         1587 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1029 247         2351 $self -> check_exact_date($id, $$line[$index]);
1030              
1031             return $self -> tag_advance
1032             (
1033             $id,
1034             ++$index,
1035             $line,
1036             {
1037 0     0   0 TIME => sub{return $self -> tag_time_value(shift, shift)},
1038             }
1039 247         35660 );
1040              
1041             } # End of tag_change_date.
1042              
1043             # --------------------------------------------------
1044              
1045             sub tag_change_date1
1046             {
1047 247     247 0 576 my($self, $index, $line) = @_;
1048 247         1960 my($id) = $self -> get_sub_name(caller 0);
1049              
1050 247         1682 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1051 247         2182 $self -> push_item($$line[$index], '');
1052              
1053             return $self -> tag_advance
1054             (
1055             $id,
1056             ++$index,
1057             $line,
1058             {
1059 247     247   1048 DATE => sub{return $self -> tag_change_date(shift, shift)},
1060 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
1061             }
1062 247         27766 );
1063              
1064             } # End of tag_change_date1.
1065              
1066             # --------------------------------------------------
1067              
1068             sub tag_character_set
1069             {
1070 5     5 0 12 my($self, $index, $line) = @_;
1071 5         66 my($id) = $self -> get_sub_name(caller 0);
1072              
1073 5         42 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1074 5         62 $self -> check_length($id, $$line[$index]);
1075 5         16 $self -> push_item($$line[$index], 'Header');
1076              
1077             return $self -> tag_advance
1078             (
1079             $id,
1080             ++$index,
1081             $line,
1082             {
1083 0     0   0 VERS => sub{return $self -> tag_version_number(shift, shift)},
1084             }
1085 5         559 );
1086              
1087             } # End of tag_character_set.
1088              
1089             # --------------------------------------------------
1090              
1091             sub tag_child_xref
1092             {
1093 153     153 0 270 my($self, $index, $line) = @_;
1094 153         1377 my($id) = $self -> get_sub_name(caller 0);
1095              
1096 153         875 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1097 153         1336 $self -> push_item($$line[$index], 'Link to INDI');
1098              
1099 153         17151 return ++$index;
1100              
1101             } # End of tag_child_xref.
1102              
1103             # --------------------------------------------------
1104              
1105             sub tag_child_linkage_status
1106             {
1107 0     0 0 0 my($self, $index, $line) = @_;
1108 0         0 my($id) = $self -> get_sub_name(caller 0);
1109              
1110 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1111 0         0 $self -> check_length($id, $$line[$index]);
1112 0         0 $self -> push_item($$line[$index], 'Individual');
1113              
1114 0         0 return ++$index;
1115              
1116             } # End of tag_child_linkage_status.
1117              
1118             # --------------------------------------------------
1119              
1120             sub tag_child_to_family_link
1121             {
1122 155     155 0 410 my($self, $index, $line) = @_;
1123 155         1646 my($id) = $self -> get_sub_name(caller 0);
1124              
1125 155         1033 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1126 155         1478 $self -> push_item($$line[$index], 'Link to FAM');
1127              
1128             return $self -> tag_advance
1129             (
1130             $id,
1131             ++$index,
1132             $line,
1133             {
1134 7     7   36 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
1135 0     0   0 PEDI => sub{return $self -> tag_pedigree_linkage_type(shift, shift)},
1136 0     0   0 STAT => sub{return $self -> tag_child_linkage_status(shift, shift)},
1137             }
1138 155         18126 );
1139              
1140             } # End of tag_child_to_family_link.
1141              
1142             # --------------------------------------------------
1143              
1144             sub tag_child_to_family_xref
1145             {
1146 0     0 0 0 my($self, $index, $line) = @_;
1147 0         0 my($id) = $self -> get_sub_name(caller 0);
1148              
1149 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1150 0         0 $self -> push_item($$line[$index], 'Link to FAM');
1151              
1152 0         0 return ++$index;
1153              
1154             } # End of tag_child_to_family_xref.
1155              
1156             # --------------------------------------------------
1157              
1158             sub tag_concat
1159             {
1160 137     137 0 205 my($self, $index, $line) = @_;
1161 137         860 my($id) = $self -> get_sub_name(caller 0);
1162              
1163 137         707 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1164 137         1086 $self -> push_item($$line[$index], 'Concat');
1165              
1166 137         15080 return ++$index;
1167              
1168             } # End of tag_concat.
1169              
1170             # --------------------------------------------------
1171              
1172             sub tag_continue
1173             {
1174 96     96 0 194 my($self, $index, $line) = @_;
1175 96         633 my($id) = $self -> get_sub_name(caller 0);
1176              
1177 96         523 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1178 96         867 $self -> push_item($$line[$index], 'Continue');
1179              
1180 96         10678 return ++$index;
1181              
1182             } # End of tag_continue.
1183              
1184             # --------------------------------------------------
1185              
1186             sub tag_copyright_gedcom_file
1187             {
1188 0     0 0 0 my($self, $index, $line) = @_;
1189 0         0 my($id) = $self -> get_sub_name(caller 0);
1190              
1191 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1192 0         0 $self -> check_length($id, $$line[$index]);
1193 0         0 $self -> push_item($$line[$index], 'Header');
1194              
1195 0         0 return ++$index;
1196              
1197             } # End of tag_copyright_gedcom_file.
1198              
1199             # --------------------------------------------------
1200              
1201             sub tag_copyright_source_data
1202             {
1203 4     4 0 17 my($self, $index, $line) = @_;
1204 4         45 my($id) = $self -> get_sub_name(caller 0);
1205              
1206 4         38 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1207 4         53 $self -> check_length($id, $$line[$index]);
1208 4         18 $self -> push_item($$line[$index], 'Copyright');
1209              
1210             return $self -> tag_advance
1211             (
1212             $id,
1213             ++$index,
1214             $line,
1215             {
1216 0     0   0 CONC => sub{return $self -> tag_concat(shift, shift)},
1217 0     0   0 CONT => sub{return $self -> tag_continue(shift, shift)},
1218             }
1219 4         623 );
1220              
1221             } # End of tag_copyright_source_data.
1222              
1223             # --------------------------------------------------
1224              
1225             sub tag_count_of_children
1226             {
1227 0     0 0 0 my($self, $index, $line) = @_;
1228 0         0 my($id) = $self -> get_sub_name(caller 0);
1229              
1230 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1231 0         0 $self -> check_length($id, $$line[$index]);
1232 0         0 $self -> push_item($$line[$index], 'Family');
1233              
1234 0         0 return ++$index;
1235              
1236             } # End of tag_child_count.
1237              
1238             # --------------------------------------------------
1239              
1240             sub tag_count_of_marriages
1241             {
1242 0     0 0 0 my($self, $index, $line) = @_;
1243 0         0 my($id) = $self -> get_sub_name(caller 0);
1244              
1245 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1246 0         0 $self -> check_length($id, $$line[$index]);
1247 0         0 $self -> push_item($$line[$index], 'Family');
1248              
1249 0         0 return ++$index;
1250              
1251             } # End of tag_count_of_marriages.
1252              
1253             # --------------------------------------------------
1254              
1255             sub tag_date_lds_ord
1256             {
1257 0     0 0 0 my($self, $index, $line) = @_;
1258 0         0 my($id) = $self -> get_sub_name(caller 0);
1259              
1260 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1261 0         0 $self -> check_date($id, $$line[$index]);
1262              
1263 0         0 return ++$index;
1264              
1265             } # End of tag_date_lds_ord.
1266              
1267             # --------------------------------------------------
1268              
1269             sub tag_date_period
1270             {
1271 1     1 0 4 my($self, $index, $line) = @_;
1272 1         9 my($id) = $self -> get_sub_name(caller 0);
1273              
1274 1         8 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1275 1         12 $self -> check_date_period($id, $$line[$index]);
1276              
1277 1         169 return ++$index;
1278              
1279             } # End of tag_date_period.
1280              
1281             # --------------------------------------------------
1282              
1283             sub tag_date_value
1284             {
1285 498     498 0 1077 my($self, $index, $line) = @_;
1286 498         4026 my($id) = $self -> get_sub_name(caller 0);
1287              
1288 498         3030 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1289 498         4658 $self -> check_date($id, $$line[$index]);
1290              
1291 498         75318 return ++$index;
1292              
1293             } # End of tag_date_value.
1294              
1295             # --------------------------------------------------
1296              
1297             sub tag_descriptive_title
1298             {
1299 0     0 0 0 my($self, $index, $line) = @_;
1300 0         0 my($id) = $self -> get_sub_name(caller 0);
1301              
1302 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1303 0         0 $self -> check_length($id, $$line[$index]);
1304 0         0 $self -> push_item($$line[$index], '');
1305              
1306 0         0 return ++$index;
1307              
1308             } # End of tag_descriptive_title.
1309              
1310             # --------------------------------------------------
1311              
1312             sub tag_endl
1313             {
1314 0     0 0 0 my($self, $index, $line) = @_;
1315 0         0 my($id) = $self -> get_sub_name(caller 0);
1316              
1317 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1318 0         0 $self -> push_item($$line[$index], 'Individual');
1319              
1320             return $self -> tag_advance
1321             (
1322             $id,
1323             ++$index,
1324             $line,
1325             {
1326 0     0   0 DATE => sub{return $self -> tag_date_lds_ord(shift, shift)},
1327 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
1328 0     0   0 PLAC => sub{return $self -> tag_place_living_ordinance(shift, shift)},
1329 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
1330 0     0   0 STAT => sub{return $self -> tag_lds_endowment_date_status(shift, shift)},
1331 0     0   0 TEMP => sub{return $self -> tag_temple_code(shift, shift)},
1332             }
1333 0         0 );
1334              
1335             } # End of tag_endl.
1336              
1337             # --------------------------------------------------
1338              
1339             sub tag_entry_recording_date
1340             {
1341 0     0 0 0 my($self, $index, $line) = @_;
1342 0         0 my($id) = $self -> get_sub_name(caller 0);
1343              
1344 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1345 0         0 $self -> check_date($id, $$line[$index]);
1346              
1347 0         0 return ++$index;
1348              
1349             } # End of tag_entry_recording_date.
1350              
1351             # --------------------------------------------------
1352              
1353             sub tag_event_detail
1354             {
1355 0     0 0 0 my($self, $index, $line) = @_;
1356 0         0 my($id) = $self -> get_sub_name(caller 0);
1357              
1358 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1359 0         0 $self -> push_item($$line[$index], 'Event');
1360              
1361 0         0 return $self -> tag_advance
1362             (
1363             $id,
1364             ++$index,
1365             $line,
1366             {
1367             $self -> tag_event_detail_tags,
1368             }
1369             );
1370              
1371             } # End of tag_event_detail.
1372              
1373             # --------------------------------------------------
1374              
1375             sub tag_event_detail_tags
1376             {
1377 501     501 0 1021 my($self) = @_;
1378              
1379             return
1380             (
1381 0     0   0 AGNC => sub{return $self -> tag_responsible_agency(shift, shift)},
1382 0     0   0 CAUS => sub{return $self -> tag_cause_of_event(shift, shift)},
1383 498     498   1850 DATE => sub{return $self -> tag_date_value(shift, shift)},
1384 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
1385 0     0   0 OBJE => sub{return $self -> tag_multimedia_link(shift, shift)},
1386 8     8   48 PLAC => sub{return $self -> tag_place_name(shift, shift)},
1387 0     0   0 RELI => sub{return $self -> tag_religious_affiliation(shift, shift)},
1388 0     0   0 RESN => sub{return $self -> tag_restriction_notice(shift, shift)},
1389 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
1390 0     0   0 TYPE => sub{return $self -> tag_event_or_fact_classification(shift, shift)},
1391 501         7450 $self -> tag_address_structure_tags,
1392             );
1393              
1394             } # End of tag_event_detail_tags.
1395              
1396             # --------------------------------------------------
1397              
1398             sub tag_event_or_fact_classification
1399             {
1400 0     0 0 0 my($self, $index, $line) = @_;
1401 0         0 my($id) = $self -> get_sub_name(caller 0);
1402              
1403 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1404 0         0 $self -> check_length($id, $$line[$index]);
1405 0         0 $self -> push_item($$line[$index], '');
1406              
1407 0         0 return ++$index;
1408              
1409             } # End of tag_event_or_fact_classification.
1410              
1411             # --------------------------------------------------
1412              
1413             sub tag_event_type_cited_from
1414             {
1415 0     0 0 0 my($self, $index, $line) = @_;
1416 0         0 my($id) = $self -> get_sub_name(caller 0);
1417              
1418 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1419 0         0 $self -> push_item($$line[$index], 'Event');
1420              
1421             return $self -> tag_advance
1422             (
1423             $id,
1424             ++$index,
1425             $line,
1426             {
1427 0     0   0 ROLE => sub{return $self -> tag_role_in_event(shift, shift)},
1428             }
1429 0         0 );
1430              
1431             } # End of tag_event_type_cited_from.
1432              
1433             # --------------------------------------------------
1434              
1435             sub tag_events_recorded
1436             {
1437 1     1 0 4 my($self, $index, $line) = @_;
1438 1         9 my($id) = $self -> get_sub_name(caller 0);
1439              
1440 1         9 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1441 1         10 $self -> check_length($id, $$line[$index]);
1442 1         4 $self -> push_item($$line[$index], 'Event');
1443              
1444             return $self -> tag_advance
1445             (
1446             $id,
1447             ++$index,
1448             $line,
1449             {
1450 1     1   7 DATE => sub{return $self -> tag_date_period(shift, shift)},
1451 0     0   0 PLAC => sub{return $self -> tag_source_jurisdiction_place(shift, shift)},
1452             }
1453 1         114 );
1454              
1455             } # End of tag_events_recorded.
1456              
1457             # --------------------------------------------------
1458              
1459             sub tag_family_event_detail
1460             {
1461 120     120 0 268 my($self, $index, $line) = @_;
1462 120         959 my($id) = $self -> get_sub_name(caller 0);
1463              
1464 120         750 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1465 120         1058 $self -> push_item($$line[$index], 'Event');
1466              
1467             return $self -> tag_advance
1468             (
1469             $id,
1470             ++$index,
1471             $line,
1472             {
1473 0     0   0 HUSB => sub{return $self -> tag_age_at_event(shift, shift)},
1474 0     0   0 WIFE => sub{return $self -> tag_age_at_event(shift, shift)},
1475 120         13213 $self -> tag_event_detail_tags,
1476             }
1477             );
1478              
1479             } # End of tag_family_event_detail.
1480              
1481             # --------------------------------------------------
1482              
1483             sub tag_file_name
1484             {
1485 1     1 0 3 my($self, $index, $line) = @_;
1486 1         8 my($id) = $self -> get_sub_name(caller 0);
1487              
1488 1         8 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1489 1         10 $self -> check_length($id, $$line[$index]);
1490 1         4 $self -> push_item($$line[$index], 'File name');
1491              
1492 1         112 return ++$index;
1493              
1494             } # End of tag_file_name.
1495              
1496             # --------------------------------------------------
1497              
1498             sub tag_family_record
1499             {
1500 123     123 0 294 my($self, $index, $line) = @_;
1501 123         1189 my($id) = $self -> get_sub_name(caller 0);
1502              
1503 123         811 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1504 123         1125 $self -> push_item($$line[$index], 'Family');
1505              
1506             return $self -> tag_advance
1507             (
1508             $id,
1509             ++$index,
1510             $line,
1511             {
1512 0     0   0 ANUL => sub{return $self -> tag_family_event_detail(shift, shift)},
1513 0     0   0 CENS => sub{return $self -> tag_family_event_detail(shift, shift)},
1514 0     0   0 CHAN => sub{return $self -> tag_change_date1(shift, shift)},
1515 153     153   514 CHIL => sub{return $self -> tag_child_xref(shift, shift)},
1516 6     6   24 DIV => sub{return $self -> tag_family_event_detail(shift, shift)},
1517 0     0   0 DIVF => sub{return $self -> tag_family_event_detail(shift, shift)},
1518 0     0   0 ENGA => sub{return $self -> tag_family_event_detail(shift, shift)},
1519 0     0   0 EVEN => sub{return $self -> tag_family_event_detail(shift, shift)},
1520 123     123   572 HUSB => sub{return $self -> tag_husband_xref(shift, shift)},
1521 0     0   0 MARB => sub{return $self -> tag_family_event_detail(shift, shift)},
1522 0     0   0 MARC => sub{return $self -> tag_family_event_detail(shift, shift)},
1523 0     0   0 MARL => sub{return $self -> tag_family_event_detail(shift, shift)},
1524 114     114   390 MARR => sub{return $self -> tag_family_event_detail(shift, shift)},
1525 0     0   0 MARS => sub{return $self -> tag_family_event_detail(shift, shift)},
1526 0     0   0 NCHIL => sub{return $self -> tag_count_of_children(shift, shift)},
1527 3     3   17 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
1528 0     0   0 OBJE => sub{return $self -> tag_multimedia_link(shift, shift)},
1529 0     0   0 REFN => sub{return $self -> tag_user_reference_number(shift, shift)},
1530 0     0   0 RESI => sub{return $self -> tag_family_event_detail(shift, shift)},
1531 0     0   0 RESN => sub{return $self -> tag_restriction_notice(shift, shift)},
1532 0     0   0 RIN => sub{return $self -> tag_rin(shift, shift)},
1533 0     0   0 SLGS => sub{return $self -> tag_lds_spouse_sealing(shift, shift)},
1534 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
1535 0     0   0 SUBM => sub{return $self -> tag_submitter_xref(shift, shift)},
1536 117     117   437 WIFE => sub{return $self -> tag_wife_xref(shift, shift)},
1537             }
1538 123         18229 );
1539              
1540             } # End of tag_family_record.
1541              
1542             # --------------------------------------------------
1543              
1544             sub tag_gedcom
1545             {
1546 5     5 0 12 my($self, $index, $line) = @_;
1547 5         42 my($id) = $self -> get_sub_name(caller 0);
1548              
1549 5         33 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1550 5         46 $self -> push_item($$line[$index], 'Header');
1551              
1552             return $self -> tag_advance
1553             (
1554             $id,
1555             ++$index,
1556             $line,
1557             {
1558 5     5   24 FORM => sub{return $self -> tag_gedcom_form(shift, shift)},
1559 5     5   22 VERS => sub{return $self -> tag_version_number(shift, shift)},
1560             }
1561 5         558 );
1562              
1563             } # End of tag_gedcom.
1564              
1565             # --------------------------------------------------
1566              
1567             sub tag_gedcom_form
1568             {
1569 5     5 0 10 my($self, $index, $line) = @_;
1570 5         41 my($id) = $self -> get_sub_name(caller 0);
1571              
1572 5         35 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1573 5         47 $self -> check_length($id, $$line[$index]);
1574 5         14 $self -> push_item($$line[$index], '');
1575              
1576 5         578 return ++$index;
1577              
1578             } # End of tag_gedcom_form.
1579              
1580             # --------------------------------------------------
1581              
1582             sub tag_generations_of_ancestors
1583             {
1584 0     0 0 0 my($self, $index, $line) = @_;
1585 0         0 my($id) = $self -> get_sub_name(caller 0);
1586              
1587 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1588 0         0 $self -> check_length($id, $$line[$index]);
1589 0         0 $self -> push_item($$line[$index], 'Submission');
1590              
1591 0         0 return ++$index;
1592              
1593             } # End of tag_generations_of_ancestors.
1594              
1595             # --------------------------------------------------
1596              
1597             sub tag_generations_of_descendants
1598             {
1599 0     0 0 0 my($self, $index, $line) = @_;
1600 0         0 my($id) = $self -> get_sub_name(caller 0);
1601              
1602 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1603 0         0 $self -> check_length($id, $$line[$index]);
1604 0         0 $self -> push_item($$line[$index], 'Submission');
1605              
1606 0         0 return ++$index;
1607              
1608             } # End of tag_generations_of_descendants.
1609              
1610             # --------------------------------------------------
1611              
1612             sub tag_header
1613             {
1614 7     7 0 31 my($self, $index, $line) = @_;
1615 7         98 my($id) = $self -> get_sub_name(caller 0);
1616              
1617 7         78 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1618 7         296 $self -> push_item($$line[$index], 'Header');
1619              
1620             return $self -> tag_advance
1621             (
1622             $id,
1623             ++$index,
1624             $line,
1625             {
1626 5     5   31 CHAR => sub{return $self -> tag_character_set(shift, shift)},
1627 0     0   0 COPR => sub{return $self -> tag_copyright_gedcom_file(shift, shift)},
1628 6     6   37 DATE => sub{return $self -> tag_transmission_date(shift, shift)},
1629 0     0   0 DEST => sub{return $self -> tag_receiving_system_name(shift, shift)},
1630 1     1   7 FILE => sub{return $self -> tag_file_name(shift, shift)},
1631 5     5   28 GEDC => sub{return $self -> tag_gedcom(shift, shift)},
1632 0     0   0 LANG => sub{return $self -> tag_language_of_text(shift, shift)},
1633 4     4   23 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
1634 0     0   0 PLAC => sub{return $self -> tag_place(shift, shift)},
1635 4     4   22 SUBM => sub{return $self -> tag_submitter_xref(shift, shift)},
1636 0     0   0 SUBN => sub{return $self -> tag_submission_xref(shift, shift)},
1637 7     7   46 SOUR => sub{return $self -> tag_approved_system_id(shift, shift)},
1638             }
1639 7         3758 );
1640              
1641             } # End of tag_header.
1642              
1643             # --------------------------------------------------
1644              
1645             sub tag_husband_xref
1646             {
1647 123     123 0 246 my($self, $index, $line) = @_;
1648 123         953 my($id) = $self -> get_sub_name(caller 0);
1649              
1650 123         835 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1651 123         1139 $self -> push_item($$line[$index], 'Link to INDI');
1652              
1653 123         14003 return ++$index;
1654              
1655             } # End of tag_husband_xref.
1656              
1657             # --------------------------------------------------
1658              
1659             sub tag_individual_attribute_detail
1660             {
1661 0     0 0 0 my($self, $index, $line) = @_;
1662 0         0 my($id) = $self -> get_sub_name(caller 0);
1663              
1664 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1665 0         0 $self -> push_item($$line[$index], 'Individual');
1666              
1667 0         0 return ++$index;
1668              
1669             } # End of tag_individual_attribute_detail.
1670              
1671             # --------------------------------------------------
1672              
1673             sub tag_individual_attribute_structure_tags
1674             {
1675 264     264 0 625 my($self) = @_;
1676              
1677             return
1678             (
1679 0     0   0 CAST => sub{return $self -> tag_caste_name(shift, shift)},
1680 0     0   0 DSCR => sub{return $self -> tag_physical_description(shift, shift)},
1681 0     0   0 EDUC => sub{return $self -> tag_scholastic_achievement(shift, shift)},
1682 0     0   0 FACT => sub{return $self -> tag_individual_attribute_detail(shift, shift)},
1683 0     0   0 IDNO => sub{return $self -> tag_national_id_number(shift, shift)},
1684 0     0   0 NATI => sub{return $self -> tag_national_or_tribal_origin(shift, shift)},
1685 0     0   0 NCHI => sub{return $self -> tag_individual_attribute_detail(shift, shift)},
1686 0     0   0 NMR => sub{return $self -> tag_count_of_marriages(shift, shift)},
1687 1     1   6 OCCU => sub{return $self -> tag_occupation(shift, shift)},
1688 0     0   0 PROP => sub{return $self -> tag_possessions(shift, shift)},
1689 0     0   0 RELI => sub{return $self -> tag_individual_attribute_detail(shift, shift)},
1690 0     0   0 RESI => sub{return $self -> tag_individual_attribute_detail(shift, shift)},
1691 0     0   0 SSN => sub{return $self -> tag_social_security_number(shift, shift)},
1692 31     31   162 TITL => sub{return $self -> tag_nobility_type_title(shift, shift)},
1693 264         5249 );
1694              
1695             } # End of tag_individual_attribute_structure_tags.
1696              
1697             # --------------------------------------------------
1698              
1699             sub tag_individual_event_detail
1700             {
1701 381     381 0 790 my($self, $index, $line) = @_;
1702 381         3728 my($id) = $self -> get_sub_name(caller 0);
1703              
1704 381         2533 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1705 381         3626 $self -> push_item($$line[$index], 'Event');
1706              
1707             return $self -> tag_advance
1708             (
1709             $id,
1710             ++$index,
1711             $line,
1712             {
1713 1     1   7 AGE => sub{return $self -> tag_age_at_event(shift, shift)},
1714 381         43017 $self -> tag_event_detail_tags,
1715             }
1716             );
1717              
1718             } # End of tag_individual_event_detail.
1719              
1720             # --------------------------------------------------
1721              
1722             sub tag_individual_event_structure_tags
1723             {
1724 264     264 0 592 my($self) = @_;
1725              
1726             return
1727             (
1728 0     0   0 ADOP => sub{return $self -> tag_individual_event_detail(shift, shift)},
1729 0     0   0 BAPM => sub{return $self -> tag_individual_event_detail(shift, shift)},
1730 0     0   0 BARM => sub{return $self -> tag_individual_event_detail(shift, shift)},
1731 0     0   0 BASM => sub{return $self -> tag_individual_event_detail(shift, shift)},
1732 0     0   0 BLES => sub{return $self -> tag_individual_event_detail(shift, shift)},
1733 201     201   755 BIRT => sub{return $self -> tag_individual_event_detail(shift, shift)},
1734 0     0   0 BURI => sub{return $self -> tag_individual_event_detail(shift, shift)},
1735 0     0   0 CENS => sub{return $self -> tag_individual_event_detail(shift, shift)},
1736 247     247   1235 CHAN => sub{return $self -> tag_change_date1(shift, shift)},
1737 2     2   9 CHR => sub{return $self -> tag_individual_event_detail(shift, shift)},
1738 0     0   0 CHRA => sub{return $self -> tag_individual_event_detail(shift, shift)},
1739 0     0   0 CONF => sub{return $self -> tag_individual_event_detail(shift, shift)},
1740 0     0   0 CREM => sub{return $self -> tag_individual_event_detail(shift, shift)},
1741 178     178   909 DEAT => sub{return $self -> tag_individual_event_detail(shift, shift)},
1742 0     0   0 EMIG => sub{return $self -> tag_individual_event_detail(shift, shift)},
1743 0     0   0 EVEN => sub{return $self -> tag_individual_event_detail(shift, shift)},
1744 0     0   0 FCOM => sub{return $self -> tag_individual_event_detail(shift, shift)},
1745 0     0   0 GRAD => sub{return $self -> tag_individual_event_detail(shift, shift)},
1746 0     0   0 IMMI => sub{return $self -> tag_individual_event_detail(shift, shift)},
1747 0     0   0 NATU => sub{return $self -> tag_individual_event_detail(shift, shift)},
1748 0     0   0 ORDN => sub{return $self -> tag_individual_event_detail(shift, shift)},
1749 0     0   0 PROB => sub{return $self -> tag_individual_event_detail(shift, shift)},
1750 0     0   0 RETI => sub{return $self -> tag_individual_event_detail(shift, shift)},
1751 0     0   0 WILL => sub{return $self -> tag_individual_event_detail(shift, shift)},
1752 264         16503 );
1753              
1754             } # End of tag_individual_event_structure_tags.
1755              
1756             # --------------------------------------------------
1757              
1758             sub tag_individual_record
1759             {
1760 264     264 0 569 my($self, $index, $line) = @_;
1761 264         3021 my($id) = $self -> get_sub_name(caller 0);
1762              
1763 264         1993 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1764 264         2910 $self -> push_item($$line[$index], 'Individual');
1765              
1766             return $self -> tag_advance
1767             (
1768             $id,
1769             ++$index,
1770             $line,
1771             {
1772 0     0   0 AFN => sub{return $self -> tag_ancestral_file_number(shift, shift)},
1773 0     0   0 ALIA => sub{return $self -> tag_alias_xref(shift, shift)},
1774 0     0   0 ANCI => sub{return $self -> tag_submitter_xref(shift, shift)},
1775 0     0   0 ASSO => sub{return $self -> tag_association_structure(shift, shift)},
1776 0     0   0 BAPL => sub{return $self -> tag_bapl_conl(shift, shift)},
1777 0     0   0 CONL => sub{return $self -> tag_bapl_conl(shift, shift)},
1778 0     0   0 DESI => sub{return $self -> tag_submitter_xref(shift, shift)},
1779 0     0   0 ENDL => sub{return $self -> tag_endl(shift, shift)},
1780 155     155   815 FAMC => sub{return $self -> tag_child_to_family_link(shift, shift)},
1781 240     240   1233 FAMS => sub{return $self -> tag_spouse_to_family_link(shift, shift)},
1782 264     264   1275 NAME => sub{return $self -> tag_name_personal(shift, shift)},
1783 0     0   0 REFN => sub{return $self -> tag_user_reference_number(shift, shift)},
1784 0     0   0 RESN => sub{return $self -> tag_restriction_notice(shift, shift)},
1785 0     0   0 RFN => sub{return $self -> tag_permanent_record_file_number(shift, shift)},
1786 1     1   7 RIN => sub{return $self -> tag_automated_record_id(shift, shift)},
1787 254     254   1227 SEX => sub{return $self -> tag_sex_value(shift, shift)},
1788 0     0   0 SLGC => sub{return $self -> tag_slgc(shift, shift)},
1789 2     2   10 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
1790 0     0   0 SUBM => sub{return $self -> tag_submitter_xref(shift, shift)},
1791 264         34793 $self -> tag_individual_attribute_structure_tags,
1792             $self -> tag_individual_event_structure_tags,
1793             }
1794             );
1795              
1796             } # End of tag_individual_record.
1797              
1798             # --------------------------------------------------
1799              
1800             sub tag_language_of_text
1801             {
1802 0     0 0 0 my($self, $index, $line) = @_;
1803 0         0 my($id) = $self -> get_sub_name(caller 0);
1804              
1805 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1806 0         0 $self -> check_length($id, $$line[$index]);
1807 0         0 $self -> push_item($$line[$index], 'Header');
1808              
1809 0         0 return ++$index;
1810              
1811             } # End of tag_language_of_text.
1812              
1813             # --------------------------------------------------
1814              
1815             sub tag_language_preference
1816             {
1817 0     0 0 0 my($self, $index, $line) = @_;
1818 0         0 my($id) = $self -> get_sub_name(caller 0);
1819              
1820 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1821 0         0 $self -> check_length($id, $$line[$index]);
1822 0         0 $self -> push_item($$line[$index], 'Submitter');
1823              
1824 0         0 return ++$index;
1825              
1826             } # End of tag_language_preference.
1827              
1828             # --------------------------------------------------
1829              
1830             sub tag_lds_baptism_date_status
1831             {
1832 0     0 0 0 my($self, $index, $line) = @_;
1833 0         0 my($id) = $self -> get_sub_name(caller 0);
1834              
1835 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1836 0         0 $self -> check_length($id, $$line[$index]);
1837 0         0 $self -> push_item($$line[$index], 'Individual');
1838              
1839             return $self -> tag_advance
1840             (
1841             $id,
1842             ++$index,
1843             $line,
1844             {
1845 0     0   0 DATE => sub{return $self -> tag_change_date1(shift, shift)},
1846             }
1847 0         0 );
1848              
1849             } # End of tag_lds_baptism_date_status.
1850              
1851             # --------------------------------------------------
1852              
1853             sub tag_lds_child_sealing_date_status
1854             {
1855 0     0 0 0 my($self, $index, $line) = @_;
1856 0         0 my($id) = $self -> get_sub_name(caller 0);
1857              
1858 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1859 0         0 $self -> check_length($id, $$line[$index]);
1860 0         0 $self -> push_item($$line[$index], 'Individual');
1861              
1862             return $self -> tag_advance
1863             (
1864             $id,
1865             ++$index,
1866             $line,
1867             {
1868 0     0   0 DATE => sub{return $self -> tag_change_date1(shift, shift)},
1869             }
1870 0         0 );
1871              
1872             } # End of tag_lds_child_sealing_date_status.
1873              
1874             # --------------------------------------------------
1875              
1876             sub tag_lds_endowment_date_status
1877             {
1878 0     0 0 0 my($self, $index, $line) = @_;
1879 0         0 my($id) = $self -> get_sub_name(caller 0);
1880              
1881 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1882 0         0 $self -> check_length($id, $$line[$index]);
1883 0         0 $self -> push_item($$line[$index], 'Individual');
1884              
1885             return $self -> tag_advance
1886             (
1887             $id,
1888             ++$index,
1889             $line,
1890             {
1891 0     0   0 DATE => sub{return $self -> tag_change_date1(shift, shift)},
1892             }
1893 0         0 );
1894              
1895             } # End of tag_lds_endowment_date_status.
1896              
1897             # --------------------------------------------------
1898              
1899             sub tag_lds_spouse_sealing
1900             {
1901 0     0 0 0 my($self, $index, $line) = @_;
1902 0         0 my($id) = $self -> get_sub_name(caller 0);
1903              
1904 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1905 0         0 $self -> check_date($id, $$line[$index]);
1906              
1907             return $self -> tag_advance
1908             (
1909             $id,
1910             ++$index,
1911             $line,
1912             {
1913 0     0   0 DATE => sub{return $self -> tag_date_lds_ord(shift, shift)},
1914 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
1915 0     0   0 PLAC => sub{return $self -> tag_place_living_ordinance(shift, shift)},
1916 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
1917 0     0   0 STAT => sub{return $self -> tag_lds_spouse_sealing_date_status(shift, shift)},
1918 0     0   0 TEMP => sub{return $self -> tag_temple_code(shift, shift)},
1919             }
1920 0         0 );
1921              
1922             } # End of tag_lds_spouse_sealing.
1923              
1924             # --------------------------------------------------
1925              
1926             sub tag_lds_spouse_sealing_date_status
1927             {
1928 0     0 0 0 my($self, $index, $line) = @_;
1929 0         0 my($id) = $self -> get_sub_name(caller 0);
1930              
1931 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1932 0         0 $self -> check_length($id, $$line[$index]);
1933 0         0 $self -> push_item($$line[$index], 'Family');
1934              
1935             return $self -> tag_advance
1936             (
1937             $id,
1938             ++$index,
1939             $line,
1940             {
1941 0     0   0 DATE => sub{return $self -> tag_change_date1(shift, shift)},
1942             }
1943 0         0 );
1944              
1945             } # End of tag_lds_spouse_sealing_date_status.
1946              
1947             # --------------------------------------------------
1948              
1949             sub tag_lineage
1950             {
1951 7     7 0 28 my($self, $index, $line) = @_;
1952 7         396 my($id) = $self -> get_sub_name(caller 0);
1953              
1954 7         107 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1955              
1956 7         159 $index = $self -> tag_header($index, $line);
1957             $index = $self -> tag_advance
1958             (
1959             $id,
1960             $index,
1961             $line,
1962             {
1963 0     0   0 SUBN => sub{return $self -> tag_submission_record(shift, shift)},
1964             }
1965 7         254 );
1966             $index = $self -> tag_advance
1967             (
1968             $id,
1969             $index,
1970             $line,
1971             {
1972 123     123   501 FAM => sub{return $self -> tag_family_record(shift, shift)},
1973 264     264   1243 INDI => sub{return $self -> tag_individual_record(shift, shift)},
1974 138     138   313 NOTE => sub{return $self -> tag_note_record(shift, shift)},
1975 0     0   0 OBJE => sub{return $self -> tag_multimedia_record(shift, shift)},
1976 0     0   0 REPO => sub{return $self -> tag_repository_record(shift, shift)},
1977 2     2   13 SOUR => sub{return $self -> tag_source_record(shift, shift)},
1978 2     2   14 SUBM => sub{return $self -> tag_submitter_record(shift, shift)},
1979             }
1980 7         141 );
1981              
1982 7         120 $self -> tag_trailer($index, $line);
1983              
1984             } # End of tag_lineage.
1985              
1986             # --------------------------------------------------
1987              
1988             sub tag_map
1989             {
1990 0     0 0 0 my($self, $index, $line) = @_;
1991 0         0 my($id) = $self -> get_sub_name(caller 0);
1992              
1993 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
1994 0         0 $self -> push_item($$line[$index], 'Place');
1995              
1996             return $self -> tag_advance
1997             (
1998             $id,
1999             ++$index,
2000             $line,
2001             {
2002 0     0   0 LATI => sub{return $self -> tag_place_latitude(shift, shift)},
2003 0     0   0 LONG => sub{return $self -> tag_place_longitude(shift, shift)},
2004             }
2005 0         0 );
2006              
2007             } # End of tag_map.
2008              
2009             # --------------------------------------------------
2010              
2011             sub tag_multimedia_link
2012             {
2013 0     0 0 0 my($self, $index, $line) = @_;
2014 0         0 my($id) = $self -> get_sub_name(caller 0);
2015              
2016 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2017 0         0 $self -> push_item($$line[$index], 'Link to OBJE');
2018              
2019             return $self -> tag_advance
2020             (
2021             $id,
2022             ++$index,
2023             $line,
2024             {
2025 0     0   0 FILE => sub{return $self -> tag_multimedia_link_file_refn(shift, shift)},
2026 0     0   0 TITL => sub{return $self -> tag_descriptive_title(shift, shift)},
2027             }
2028 0         0 );
2029              
2030             } # End of tag_multimedia_link.
2031              
2032             # --------------------------------------------------
2033              
2034             sub tag_multimedia_link_file_refn
2035             {
2036 0     0 0 0 my($self, $index, $line) = @_;
2037 0         0 my($id) = $self -> get_sub_name(caller 0);
2038              
2039 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2040 0         0 $self -> check_length($index, 'multimedia_file_reference', $$line[$index][4]);
2041 0         0 $self -> push_item($$line[$index], 'Multimedia');
2042              
2043             return $self -> tag_advance
2044             (
2045             $id,
2046             ++$index,
2047             $line,
2048             {
2049 0     0   0 FORM => sub{return $self -> tag_multimedia_link_format(shift, shift)},
2050             }
2051 0         0 );
2052              
2053             } # End of tag_multimedia_link_file_refn.
2054              
2055             # --------------------------------------------------
2056              
2057             sub tag_multimedia_link_format
2058             {
2059 0     0 0 0 my($self, $index, $line) = @_;
2060 0         0 my($id) = $self -> get_sub_name(caller 0);
2061              
2062 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2063 0         0 $self -> check_length($id, $$line[$index]);
2064 0         0 $self -> push_item($$line[$index], 'Multimedia');
2065              
2066             return $self -> tag_advance
2067             (
2068             $id,
2069             ++$index,
2070             $line,
2071             {
2072 0     0   0 MEDI => sub{return $self -> tag_source_media_type(shift, shift)},
2073             }
2074 0         0 );
2075              
2076             } # End of tag_multimedia_link_format.
2077              
2078             # --------------------------------------------------
2079              
2080             sub tag_multimedia_record
2081             {
2082 0     0 0 0 my($self, $index, $line) = @_;
2083 0         0 my($id) = $self -> get_sub_name(caller 0);
2084              
2085 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2086 0         0 $self -> push_item($$line[$index], 'Multimedia');
2087              
2088             return $self -> tag_advance
2089             (
2090             $id,
2091             ++$index,
2092             $line,
2093             {
2094 0     0   0 CHAN => sub{return $self -> tag_change_date1(shift, shift)},
2095 0     0   0 FILE => sub{return $self -> tag_multimedia_record_file_refn(shift, shift)},
2096 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
2097 0     0   0 REFN => sub{return $self -> tag_user_reference_number(shift, shift)},
2098 0     0   0 RIN => sub{return $self -> tag_automated_record_id(shift, shift)},
2099 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
2100             }
2101 0         0 );
2102              
2103             } # End of tag_multimedia_record.
2104              
2105             # --------------------------------------------------
2106              
2107             sub tag_multimedia_record_file_refn
2108             {
2109 0     0 0 0 my($self, $index, $line) = @_;
2110 0         0 my($id) = $self -> get_sub_name(caller 0);
2111              
2112 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2113 0         0 $self -> check_length($index, 'multimedia_file_reference', $$line[$index][4]);
2114 0         0 $self -> push_item($$line[$index], 'Multimedia');
2115              
2116             return $self -> tag_advance
2117             (
2118             $id,
2119             ++$index,
2120             $line,
2121             {
2122 0     0   0 FORM => sub{return $self -> tag_multimedia_record_format(shift, shift)},
2123 0     0   0 TITL => sub{return $self -> tag_descriptive_title(shift, shift)},
2124             }
2125 0         0 );
2126              
2127             } # End of tag_multimedia_record_file_refn.
2128              
2129             # --------------------------------------------------
2130              
2131             sub tag_multimedia_record_format
2132             {
2133 0     0 0 0 my($self, $index, $line) = @_;
2134 0         0 my($id) = $self -> get_sub_name(caller 0);
2135              
2136 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2137 0         0 $self -> check_length($id, $$line[$index]);
2138 0         0 $self -> push_item($$line[$index], 'Multimedia');
2139              
2140             return $self -> tag_advance
2141             (
2142             $id,
2143             ++$index,
2144             $line,
2145             {
2146 0     0   0 TYPE => sub{return $self -> tag_source_media_type(shift, shift)},
2147             }
2148 0         0 );
2149              
2150             } # End of tag_multimedia_record_format.
2151              
2152             # --------------------------------------------------
2153              
2154             sub tag_name_of_business
2155             {
2156 6     6 0 22 my($self, $index, $line) = @_;
2157 6         206 my($id) = $self -> get_sub_name(caller 0);
2158              
2159 6         64 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2160 6         92 $self -> check_length($id, $$line[$index]);
2161 6         33 $self -> push_item($$line[$index], '');
2162              
2163 6         1066 return $self -> tag_advance
2164             (
2165             $id,
2166             ++$index,
2167             $line,
2168             {
2169             $self -> tag_address_structure_tags,
2170             }
2171             );
2172              
2173             } # End of tag_name_of_business.
2174              
2175             # --------------------------------------------------
2176              
2177             sub tag_name_of_family_file
2178             {
2179 0     0 0 0 my($self, $index, $line) = @_;
2180 0         0 my($id) = $self -> get_sub_name(caller 0);
2181              
2182 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2183 0         0 $self -> check_length($id, $$line[$index]);
2184 0         0 $self -> push_item($$line[$index], 'File name');
2185              
2186 0         0 return ++$index;
2187              
2188             } # End of tag_name_of_family_file.
2189              
2190             # --------------------------------------------------
2191              
2192             sub tag_name_of_product
2193             {
2194 7     7 0 22 my($self, $index, $line) = @_;
2195 7         94 my($id) = $self -> get_sub_name(caller 0);
2196              
2197 7         72 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2198 7         96 $self -> check_length($id, $$line[$index]);
2199 7         33 $self -> push_item($$line[$index], '');
2200              
2201 7         1293 return ++$index;
2202              
2203             } # End of tag_name_of_product.
2204              
2205             # --------------------------------------------------
2206              
2207             sub tag_name_of_repository
2208             {
2209 0     0 0 0 my($self, $index, $line) = @_;
2210 0         0 my($id) = $self -> get_sub_name(caller 0);
2211              
2212 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2213 0         0 $self -> check_length($id, $$line[$index]);
2214 0         0 $self -> push_item($$line[$index], 'Repository');
2215              
2216 0         0 return ++$index;
2217              
2218             } # End of tag_name_of_repository.
2219              
2220             # --------------------------------------------------
2221              
2222             sub tag_name_of_source_data
2223             {
2224 5     5 0 18 my($self, $index, $line) = @_;
2225 5         62 my($id) = $self -> get_sub_name(caller 0);
2226              
2227 5         50 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2228 5         72 $self -> check_length($id, $$line[$index]);
2229 5         25 $self -> push_item($$line[$index], 'Source');
2230              
2231             return $self -> tag_advance
2232             (
2233             $id,
2234             ++$index,
2235             $line,
2236             {
2237 2     2   18 DATE => sub{return $self -> tag_publication_date(shift, shift)},
2238 4     4   24 COPR => sub{return $self -> tag_copyright_source_data(shift, shift)},
2239             }
2240 5         936 );
2241              
2242             } # End of tag_name_of_source_data.
2243              
2244             # --------------------------------------------------
2245              
2246             sub tag_name_personal
2247             {
2248 264     264 0 513 my($self, $index, $line) = @_;
2249 264         2365 my($id) = $self -> get_sub_name(caller 0);
2250              
2251 264         1837 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2252 264         2666 $self -> check_length($id, $$line[$index]);
2253 264         925 $self -> push_item($$line[$index], 'Individual');
2254              
2255             return $self -> tag_advance
2256             (
2257             $id,
2258             ++$index,
2259             $line,
2260             {
2261 0     0   0 FONE => sub{return $self -> tag_name_phonetic_variation(shift, shift)},
2262 0     0   0 ROMN => sub{return $self -> tag_name_romanized_variation(shift, shift)},
2263 0     0   0 TYPE => sub{return $self -> tag_name_type(shift, shift)},
2264 264         31203 $self -> tag_personal_name_piece_tags,
2265             }
2266             );
2267              
2268             } # End of tag_name_personal.
2269              
2270             # --------------------------------------------------
2271              
2272             sub tag_name_phonetic_variation
2273             {
2274 0     0 0 0 my($self, $index, $line) = @_;
2275 0         0 my($id) = $self -> get_sub_name(caller 0);
2276              
2277 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2278 0         0 $self -> check_length($id, $$line[$index]);
2279 0         0 $self -> push_item($$line[$index], 'Individual');
2280              
2281             return $self -> tag_advance
2282             (
2283             $id,
2284             ++$index,
2285             $line,
2286             {
2287 0     0   0 TYPE => sub{return $self -> tag_phonetic_type(shift, shift)},
2288 0         0 $self -> tag_personal_name_piece_tags,
2289             }
2290             );
2291              
2292             } # End of tag_name_phonetic_variation.
2293              
2294             # --------------------------------------------------
2295              
2296             sub tag_name_piece_given
2297             {
2298 0     0 0 0 my($self, $index, $line) = @_;
2299 0         0 my($id) = $self -> get_sub_name(caller 0);
2300              
2301 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2302 0         0 $self -> check_length($id, $$line[$index]);
2303 0         0 $self -> push_item($$line[$index], 'Individual');
2304              
2305 0         0 return ++$index;
2306              
2307             } # End of tag_name_piece_given.
2308              
2309             # --------------------------------------------------
2310              
2311             sub tag_name_piece_nickname
2312             {
2313 0     0 0 0 my($self, $index, $line) = @_;
2314 0         0 my($id) = $self -> get_sub_name(caller 0);
2315              
2316 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2317 0         0 $self -> check_length($id, $$line[$index]);
2318 0         0 $self -> push_item($$line[$index], 'Individual');
2319              
2320 0         0 return ++$index;
2321              
2322             } # End of tag_name_piece_nickname.
2323              
2324             # --------------------------------------------------
2325              
2326             sub tag_name_piece_prefix
2327             {
2328 0     0 0 0 my($self, $index, $line) = @_;
2329 0         0 my($id) = $self -> get_sub_name(caller 0);
2330              
2331 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2332 0         0 $self -> check_length($id, $$line[$index]);
2333 0         0 $self -> push_item($$line[$index], 'Individual');
2334              
2335 0         0 return ++$index;
2336              
2337             } # End of tag_name_piece_prefix.
2338              
2339             # --------------------------------------------------
2340              
2341             sub tag_name_piece_suffix
2342             {
2343 0     0 0 0 my($self, $index, $line) = @_;
2344 0         0 my($id) = $self -> get_sub_name(caller 0);
2345              
2346 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2347 0         0 $self -> check_length($id, $$line[$index]);
2348 0         0 $self -> push_item($$line[$index], 'Individual');
2349              
2350 0         0 return ++$index;
2351              
2352             } # End of tag_name_piece_suffix.
2353              
2354             # --------------------------------------------------
2355              
2356             sub tag_name_piece_surname
2357             {
2358 0     0 0 0 my($self, $index, $line) = @_;
2359 0         0 my($id) = $self -> get_sub_name(caller 0);
2360              
2361 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2362 0         0 $self -> check_length($id, $$line[$index]);
2363 0         0 $self -> push_item($$line[$index], 'Individual');
2364              
2365 0         0 return ++$index;
2366              
2367             } # End of tag_name_piece_surname.
2368              
2369             # --------------------------------------------------
2370              
2371             sub tag_name_piece_surname_prefix
2372             {
2373 0     0 0 0 my($self, $index, $line) = @_;
2374 0         0 my($id) = $self -> get_sub_name(caller 0);
2375              
2376 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2377 0         0 $self -> check_length($id, $$line[$index]);
2378 0         0 $self -> push_item($$line[$index], 'Individual');
2379              
2380 0         0 return ++$index;
2381              
2382             } # End of tag_name_piece_surname_prefix.
2383              
2384             # --------------------------------------------------
2385              
2386             sub tag_name_romanized_variation
2387             {
2388 0     0 0 0 my($self, $index, $line) = @_;
2389 0         0 my($id) = $self -> get_sub_name(caller 0);
2390              
2391 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2392 0         0 $self -> check_length($id, $$line[$index]);
2393 0         0 $self -> push_item($$line[$index], 'Individual');
2394              
2395             return $self -> tag_advance
2396             (
2397             $id,
2398             ++$index,
2399             $line,
2400             {
2401 0     0   0 TYPE => sub{return $self -> tag_romanized_type(shift, shift)},
2402 0         0 $self -> tag_personal_name_piece_tags,
2403             }
2404             );
2405              
2406             } # End of tag_name_romanized_variation.
2407              
2408             # --------------------------------------------------
2409              
2410             sub tag_name_type
2411             {
2412 0     0 0 0 my($self, $index, $line) = @_;
2413 0         0 my($id) = $self -> get_sub_name(caller 0);
2414              
2415 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2416 0         0 $self -> check_length($id, $$line[$index]);
2417 0         0 $self -> push_item($$line[$index], 'Individual');
2418              
2419 0         0 return ++$index;
2420              
2421             } # End of tag_name_type.
2422              
2423             # --------------------------------------------------
2424              
2425             sub tag_national_or_tribal_origin
2426             {
2427 0     0 0 0 my($self, $index, $line) = @_;
2428 0         0 my($id) = $self -> get_sub_name(caller 0);
2429              
2430 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2431 0         0 $self -> check_length($id, $$line[$index]);
2432 0         0 $self -> push_item($$line[$index], 'Individual');
2433              
2434 0         0 return ++$index;
2435              
2436             } # End of tag_national_or_tribal_origin.
2437              
2438             # --------------------------------------------------
2439              
2440             sub tag_national_id_number
2441             {
2442 0     0 0 0 my($self, $index, $line) = @_;
2443 0         0 my($id) = $self -> get_sub_name(caller 0);
2444              
2445 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2446 0         0 $self -> check_length($id, $$line[$index]);
2447 0         0 $self -> push_item($$line[$index], 'Individual');
2448              
2449 0         0 return ++$index;
2450              
2451             } # End of tag_national_id_number.
2452              
2453             # --------------------------------------------------
2454              
2455             sub tag_nobility_type_title
2456             {
2457 31     31 0 63 my($self, $index, $line) = @_;
2458 31         358 my($id) = $self -> get_sub_name(caller 0);
2459              
2460 31         247 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2461 31         333 $self -> check_length($id, $$line[$index]);
2462 31         94 $self -> push_item($$line[$index], 'Individual');
2463              
2464 31         3712 return ++$index;
2465              
2466             } # End of tag_nobility_type_title.
2467              
2468             # --------------------------------------------------
2469              
2470             sub tag_note_record
2471             {
2472 138     138 0 234 my($self, $index, $line) = @_;
2473 138         860 my($id) = $self -> get_sub_name(caller 0);
2474              
2475 138         726 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2476 138         1132 $self -> push_item($$line[$index], 'Note');
2477              
2478             return $self -> tag_advance
2479             (
2480             $id,
2481             ++$index,
2482             $line,
2483             {
2484 0     0   0 CHAN => sub{return $self -> tag_change_date1(shift, shift)},
2485 135     135   311 CONC => sub{return $self -> tag_concat(shift, shift)},
2486 60     60   140 CONT => sub{return $self -> tag_continue(shift, shift)},
2487 0     0   0 REFN => sub{return $self -> tag_user_reference_number(shift, shift)},
2488 0     0   0 RIN => sub{return $self -> tag_automated_record_id(shift, shift)},
2489 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
2490             }
2491 138         15430 );
2492              
2493             } # End of tag_note_record.
2494              
2495             # --------------------------------------------------
2496              
2497             sub tag_note_structure
2498             {
2499 144     144 0 327 my($self, $index, $line) = @_;
2500 144         1153 my($id) = $self -> get_sub_name(caller 0);
2501              
2502 144         950 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2503 144         1287 $self -> push_item($$line[$index], 'Note');
2504              
2505             return $self -> tag_advance
2506             (
2507             $id,
2508             ++$index,
2509             $line,
2510             {
2511 2     2   13 CONC => sub{return $self -> tag_concat(shift, shift)},
2512 34     34   98 CONT => sub{return $self -> tag_continue(shift, shift)},
2513             }
2514 144         16280 );
2515              
2516             } # End of tag_note_structure.
2517              
2518             # --------------------------------------------------
2519              
2520             sub tag_occupation
2521             {
2522 1     1 0 3 my($self, $index, $line) = @_;
2523 1         9 my($id) = $self -> get_sub_name(caller 0);
2524              
2525 1         8 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2526 1         10 $self -> check_length($id, $$line[$index]);
2527 1         4 $self -> push_item($$line[$index], 'Individual');
2528              
2529 1         113 return ++$index;
2530              
2531             } # End of tag_occupation.
2532              
2533             # --------------------------------------------------
2534              
2535             sub tag_ordinance_process_flag
2536             {
2537 0     0 0 0 my($self, $index, $line) = @_;
2538 0         0 my($id) = $self -> get_sub_name(caller 0);
2539              
2540 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2541 0         0 $self -> check_length($id, $$line[$index]);
2542 0         0 $self -> push_item($$line[$index], 'Submission');
2543              
2544 0         0 return ++$index;
2545              
2546             } # End of tag_ordinance_process_flag.
2547              
2548             # --------------------------------------------------
2549              
2550             sub tag_pedigree_linkage_type
2551             {
2552 0     0 0 0 my($self, $index, $line) = @_;
2553 0         0 my($id) = $self -> get_sub_name(caller 0);
2554              
2555 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2556 0         0 $self -> check_length($id, $$line[$index]);
2557 0         0 $self -> push_item($$line[$index], 'Individual');
2558              
2559 0         0 return ++$index;
2560              
2561             } # End of tag_pedigree_linkage_type.
2562              
2563             # --------------------------------------------------
2564              
2565             sub tag_permanent_record_file_number
2566             {
2567 0     0 0 0 my($self, $index, $line) = @_;
2568 0         0 my($id) = $self -> get_sub_name(caller 0);
2569              
2570 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2571 0         0 $self -> check_length($id, $$line[$index]);
2572 0         0 $self -> push_item($$line[$index], '');
2573              
2574 0         0 return ++$index;
2575              
2576             } # End of tag_permanent_record_file_number.
2577              
2578             # --------------------------------------------------
2579              
2580             sub tag_personal_name_piece_tags
2581             {
2582 264     264 0 564 my($self) = @_;
2583              
2584             return
2585             (
2586 0     0   0 GIVN => sub{return $self -> tag_name_piece_given(shift, shift)},
2587 0     0   0 NICK => sub{return $self -> tag_name_piece_nickname(shift, shift)},
2588 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
2589 0     0   0 NPFX => sub{return $self -> tag_name_piece_prefix(shift, shift)},
2590 0     0   0 NSFX => sub{return $self -> tag_name_piece_suffix(shift, shift)},
2591 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
2592 0     0   0 SPFX => sub{return $self -> tag_name_piece_surname_prefix(shift, shift)},
2593 0     0   0 SURN => sub{return $self -> tag_name_piece_surname(shift, shift)},
2594 264         5749 );
2595              
2596             } # End of tag_personal_name_piece_tags.
2597              
2598             # --------------------------------------------------
2599              
2600             sub tag_personal_name_pieces
2601             {
2602 0     0 0 0 my($self, $index, $line) = @_;
2603 0         0 my($id) = $self -> get_sub_name(caller 0);
2604              
2605 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2606 0         0 $self -> push_item($$line[$index], 'Individual');
2607              
2608             # Special case. $index not ++$index.
2609              
2610 0         0 return $self -> tag_advance
2611             (
2612             $id,
2613             ++$index,
2614             $line,
2615             {
2616             $self -> tag_personal_name_piece_tags
2617             }
2618             );
2619              
2620             } # End of tag_personal_name_pieces.
2621              
2622             # --------------------------------------------------
2623              
2624             sub tag_phone_number
2625             {
2626 2     2 0 5 my($self, $index, $line) = @_;
2627 2         18 my($id) = $self -> get_sub_name(caller 0);
2628              
2629 2         15 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2630 2         20 $self -> check_length($id, $$line[$index]);
2631 2         7 $self -> push_item($$line[$index], '');
2632              
2633 2         230 return ++$index;
2634              
2635             } # End of tag_phone_number.
2636              
2637             # --------------------------------------------------
2638              
2639             sub tag_phonetic_type
2640             {
2641 0     0 0 0 my($self, $index, $line) = @_;
2642 0         0 my($id) = $self -> get_sub_name(caller 0);
2643              
2644 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2645 0         0 $self -> check_length($id, $$line[$index]);
2646 0         0 $self -> push_item($$line[$index], '');
2647              
2648 0         0 return ++$index;
2649              
2650             } # End of tag_phonetic_type.
2651              
2652             # --------------------------------------------------
2653              
2654             sub tag_physical_description
2655             {
2656 0     0 0 0 my($self, $index, $line) = @_;
2657 0         0 my($id) = $self -> get_sub_name(caller 0);
2658              
2659 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2660 0         0 $self -> check_length($id, $$line[$index]);
2661 0         0 $self -> push_item($$line[$index], '');
2662              
2663 0         0 return ++$index;
2664              
2665             } # End of tag_physical_description.
2666              
2667             # --------------------------------------------------
2668              
2669             sub tag_place
2670             {
2671 0     0 0 0 my($self, $index, $line) = @_;
2672 0         0 my($id) = $self -> get_sub_name(caller 0);
2673              
2674 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2675 0         0 $self -> push_item($$line[$index], 'Place');
2676              
2677             return $self -> tag_advance
2678             (
2679             $id,
2680             ++$index,
2681             $line,
2682             {
2683 0     0   0 FORM => sub{return $self -> tag_place_hierarchy(shift, shift)},
2684             }
2685 0         0 );
2686              
2687             } # End of tag_place.
2688              
2689             # --------------------------------------------------
2690              
2691             sub tag_place_hierarchy
2692             {
2693 0     0 0 0 my($self, $index, $line) = @_;
2694 0         0 my($id) = $self -> get_sub_name(caller 0);
2695              
2696 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2697 0         0 $self -> check_length($id, $$line[$index]);
2698 0         0 $self -> push_item($$line[$index], 'Place');
2699              
2700 0         0 return ++$index;
2701              
2702             } # End of tag_place_hierarchy.
2703              
2704             # --------------------------------------------------
2705              
2706             sub tag_place_latitude
2707             {
2708 0     0 0 0 my($self, $index, $line) = @_;
2709 0         0 my($id) = $self -> get_sub_name(caller 0);
2710              
2711 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2712 0         0 $self -> check_length($id, $$line[$index]);
2713 0         0 $self -> push_item($$line[$index], 'Place');
2714              
2715 0         0 return ++$index;
2716              
2717             } # End of tag_place_latitude.
2718              
2719             # --------------------------------------------------
2720              
2721             sub tag_place_living_ordinance
2722             {
2723 0     0 0 0 my($self, $index, $line) = @_;
2724 0         0 my($id) = $self -> get_sub_name(caller 0);
2725              
2726 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2727 0         0 $self -> check_length($id, $$line[$index]);
2728 0         0 $self -> push_item($$line[$index], 'Place');
2729              
2730 0         0 return ++$index;
2731              
2732             } # End of tag_place_living_ordinance.
2733              
2734             # --------------------------------------------------
2735              
2736             sub tag_place_longitude
2737             {
2738 0     0 0 0 my($self, $index, $line) = @_;
2739 0         0 my($id) = $self -> get_sub_name(caller 0);
2740              
2741 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2742 0         0 $self -> check_length($id, $$line[$index]);
2743 0         0 $self -> push_item($$line[$index], 'Place');
2744              
2745 0         0 return ++$index;
2746              
2747             } # End of tag_place_longitude.
2748              
2749             # --------------------------------------------------
2750              
2751             sub tag_place_name
2752             {
2753 8     8 0 21 my($self, $index, $line) = @_;
2754 8         103 my($id) = $self -> get_sub_name(caller 0);
2755              
2756 8         141 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2757 8         87 $self -> check_length($id, $$line[$index]);
2758 8         25 $self -> push_item($$line[$index], 'Place');
2759              
2760             return $self -> tag_advance
2761             (
2762             $id,
2763             ++$index,
2764             $line,
2765             {
2766 0     0   0 FORM => sub{return $self -> tag_place_hierarchy(shift, shift)},
2767 0     0   0 FONE => sub{return $self -> tag_place_phonetic_variation(shift, shift)},
2768 0     0   0 MAP => sub{return $self -> tag_map(shift, shift)},
2769 0     0   0 ROMN => sub{return $self -> tag_place_romanized_variation(shift, shift)},
2770 2     2   14 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
2771             }
2772 8         1191 );
2773              
2774             } # End of tag_place_name.
2775              
2776             # --------------------------------------------------
2777              
2778             sub tag_place_phonetic_variation
2779             {
2780 0     0 0 0 my($self, $index, $line) = @_;
2781 0         0 my($id) = $self -> get_sub_name(caller 0);
2782              
2783 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2784 0         0 $self -> check_length($id, $$line[$index]);
2785 0         0 $self -> push_item($$line[$index], 'Place');
2786              
2787             return $self -> tag_advance
2788             (
2789             $id,
2790             ++$index,
2791             $line,
2792             {
2793 0     0   0 TYPE => sub{return $self -> tag_phonetic_type(shift, shift)},
2794             }
2795 0         0 );
2796              
2797             } # End of tag_place_phonetic_variation.
2798              
2799             # --------------------------------------------------
2800              
2801             sub tag_place_romanized_variation
2802             {
2803 0     0 0 0 my($self, $index, $line) = @_;
2804 0         0 my($id) = $self -> get_sub_name(caller 0);
2805              
2806 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2807 0         0 $self -> check_length($id, $$line[$index]);
2808 0         0 $self -> push_item($$line[$index], 'Place');
2809              
2810             return $self -> tag_advance
2811             (
2812             $id,
2813             ++$index,
2814             $line,
2815             {
2816 0     0   0 TYPE => sub{return $self -> tag_romanized_type(shift, shift)},
2817             }
2818 0         0 );
2819              
2820             } # End of tag_place_romanized_variation.
2821              
2822             # --------------------------------------------------
2823              
2824             sub tag_possessions
2825             {
2826 0     0 0 0 my($self, $index, $line) = @_;
2827 0         0 my($id) = $self -> get_sub_name(caller 0);
2828              
2829 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2830 0         0 $self -> check_length($id, $$line[$index]);
2831 0         0 $self -> push_item($$line[$index], '');
2832              
2833 0         0 return ++$index;
2834              
2835             } # End of tag_possessions.
2836              
2837             # --------------------------------------------------
2838              
2839             sub tag_publication_date
2840             {
2841 2     2 0 9 my($self, $index, $line) = @_;
2842 2         35 my($id) = $self -> get_sub_name(caller 0);
2843              
2844 2         29 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2845 2         37 $self -> check_exact_date($id, $$line[$index]);
2846              
2847 2         341 return ++$index;
2848              
2849             } # End of tag_publication_date.
2850              
2851             # --------------------------------------------------
2852              
2853             sub tag_receiving_system_name
2854             {
2855 0     0 0 0 my($self, $index, $line) = @_;
2856 0         0 my($id) = $self -> get_sub_name(caller 0);
2857              
2858 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2859 0         0 $self -> check_length($id, $$line[$index]);
2860 0         0 $self -> push_item($$line[$index], 'Header');
2861              
2862 0         0 return ++$index;
2863              
2864             } # End of tag_receiving_system_name.
2865              
2866             # --------------------------------------------------
2867              
2868             sub tag_relation_is_descriptor
2869             {
2870 0     0 0 0 my($self, $index, $line) = @_;
2871 0         0 my($id) = $self -> get_sub_name(caller 0);
2872              
2873 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2874 0         0 $self -> check_length($id, $$line[$index]);
2875 0         0 $self -> push_item($$line[$index], '');
2876              
2877 0         0 return ++$index;
2878              
2879             } # End of tag_relation_is_descriptor.
2880              
2881             # --------------------------------------------------
2882              
2883             sub tag_religious_affiliation
2884             {
2885 0     0 0 0 my($self, $index, $line) = @_;
2886 0         0 my($id) = $self -> get_sub_name(caller 0);
2887              
2888 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2889 0         0 $self -> check_length($id, $$line[$index]);
2890 0         0 $self -> push_item($$line[$index], 'Individual');
2891              
2892 0         0 return ++$index;
2893              
2894             } # End of tag_religious_affiliation.
2895              
2896             # --------------------------------------------------
2897              
2898             sub tag_repository_record
2899             {
2900 0     0 0 0 my($self, $index, $line) = @_;
2901 0         0 my($id) = $self -> get_sub_name(caller 0);
2902              
2903 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2904 0         0 $self -> push_item($$line[$index], 'Repository');
2905              
2906             return $self -> tag_advance
2907             (
2908             $id,
2909             ++$index,
2910             $line,
2911             {
2912 0     0   0 CHAN => sub{return $self -> tag_change_date1(shift, shift)},
2913 0     0   0 NAME => sub{return $self -> tag_name_of_repository(shift, shift)},
2914 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
2915 0     0   0 REFN => sub{return $self -> tag_user_reference_number(shift, shift)},
2916 0     0   0 RIN => sub{return $self -> tag_automated_record_id(shift, shift)},
2917 0         0 $self -> tag_address_structure_tags,
2918             }
2919             );
2920              
2921             } # End of tag_repository_record.
2922              
2923             # --------------------------------------------------
2924              
2925             sub tag_responsible_agency
2926             {
2927 0     0 0 0 my($self, $index, $line) = @_;
2928 0         0 my($id) = $self -> get_sub_name(caller 0);
2929              
2930 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2931 0         0 $self -> check_length($id, $$line[$index]);
2932 0         0 $self -> push_item($$line[$index], 'Source');
2933              
2934 0         0 return ++$index;
2935              
2936             } # End of tag_responsible_agency.
2937              
2938             # --------------------------------------------------
2939              
2940             sub tag_restriction_notice
2941             {
2942 0     0 0 0 my($self, $index, $line) = @_;
2943 0         0 my($id) = $self -> get_sub_name(caller 0);
2944              
2945 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2946 0         0 $self -> check_length($id, $$line[$index]);
2947 0         0 $self -> push_item($$line[$index], '');
2948              
2949 0         0 return ++$index;
2950              
2951             } # End of tag_restriction_notice.
2952              
2953             # --------------------------------------------------
2954              
2955             sub tag_rin
2956             {
2957 0     0 0 0 my($self, $index, $line) = @_;
2958 0         0 my($id) = $self -> get_sub_name(caller 0);
2959              
2960 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2961 0         0 $self -> push_item($$line[$index], '');
2962              
2963 0         0 return ++$index;
2964              
2965             } # End of tag_rin.
2966              
2967             # --------------------------------------------------
2968              
2969             sub tag_role_in_event
2970             {
2971 0     0 0 0 my($self, $index, $line) = @_;
2972 0         0 my($id) = $self -> get_sub_name(caller 0);
2973              
2974 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2975 0         0 $self -> check_length($id, $$line[$index]);
2976 0         0 $self -> push_item($$line[$index], 'Source');
2977              
2978 0         0 return ++$index;
2979              
2980             } # End of tag_role_in_event.
2981              
2982             # --------------------------------------------------
2983              
2984             sub tag_romanized_type
2985             {
2986 0     0 0 0 my($self, $index, $line) = @_;
2987 0         0 my($id) = $self -> get_sub_name(caller 0);
2988              
2989 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
2990 0         0 $self -> check_length($id, $$line[$index]);
2991 0         0 $self -> push_item($$line[$index], '');
2992              
2993 0         0 return ++$index;
2994              
2995             } # End of tag_romanized_type.
2996              
2997             # --------------------------------------------------
2998              
2999             sub tag_scholastic_achievement
3000             {
3001 0     0 0 0 my($self, $index, $line) = @_;
3002 0         0 my($id) = $self -> get_sub_name(caller 0);
3003              
3004 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3005 0         0 $self -> check_length($id, $$line[$index]);
3006 0         0 $self -> push_item($$line[$index], 'Individual');
3007              
3008 0         0 return ++$index;
3009              
3010             } # End of tag_scholastic_achievement.
3011              
3012             # --------------------------------------------------
3013              
3014             sub tag_sex_value
3015             {
3016 254     254 0 491 my($self, $index, $line) = @_;
3017 254         2085 my($id) = $self -> get_sub_name(caller 0);
3018              
3019 254         1683 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3020 254         2345 $self -> check_length($id, $$line[$index]);
3021 254         789 $self -> push_item($$line[$index], 'Individual');
3022              
3023 254         30183 return ++$index;
3024              
3025             } # End of tag_sex_value.
3026              
3027             # --------------------------------------------------
3028              
3029             sub tag_slgc
3030             {
3031 0     0 0 0 my($self, $index, $line) = @_;
3032 0         0 my($id) = $self -> get_sub_name(caller 0);
3033              
3034 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3035 0         0 $self -> push_item($$line[$index], 'Individual');
3036              
3037             return $self -> tag_advance
3038             (
3039             $id,
3040             ++$index,
3041             $line,
3042             {
3043 0     0   0 DATE => sub{return $self -> tag_date_lds_ord(shift, shift)},
3044 0     0   0 FAMC => sub{return $self -> tag_child_to_family_xref(shift, shift)},
3045 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3046 0     0   0 PLAC => sub{return $self -> tag_place_living_ordinance(shift, shift)},
3047 0     0   0 SOUR => sub{return $self -> tag_source_citation(shift, shift)},
3048 0     0   0 STAT => sub{return $self -> tag_lds_child_sealing_date_status(shift, shift)},
3049 0     0   0 TEMP => sub{return $self -> tag_temple_code(shift, shift)},
3050             }
3051 0         0 );
3052              
3053             } # End of tag_slgc.
3054              
3055             # --------------------------------------------------
3056              
3057             sub tag_social_security_number
3058             {
3059 0     0 0 0 my($self, $index, $line) = @_;
3060 0         0 my($id) = $self -> get_sub_name(caller 0);
3061              
3062 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3063 0         0 $self -> check_length($id, $$line[$index]);
3064 0         0 $self -> push_item($$line[$index], 'Individual');
3065              
3066 0         0 return ++$index;
3067              
3068             } # End of tag_social_security_number.
3069              
3070             # --------------------------------------------------
3071              
3072             sub tag_source_call_number
3073             {
3074 0     0 0 0 my($self, $index, $line) = @_;
3075 0         0 my($id) = $self -> get_sub_name(caller 0);
3076              
3077 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3078 0         0 $self -> check_length($id, $$line[$index]);
3079 0         0 $self -> push_item($$line[$index], 'Source');
3080              
3081 0         0 return ++$index;
3082              
3083             } # End of tag_source_call_number.
3084              
3085             # --------------------------------------------------
3086              
3087             sub tag_source_citation
3088             {
3089 2     2 0 5 my($self, $index, $line) = @_;
3090 2         20 my($id) = $self -> get_sub_name(caller 0);
3091              
3092 2         14 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3093 2         19 $self -> push_item($$line[$index], 'Source');
3094              
3095             return $self -> tag_advance
3096             (
3097             $id,
3098             ++$index,
3099             $line,
3100             {
3101 0     0   0 CONC => sub{return $self -> tag_concat(shift, shift)},
3102 0     0   0 CONT => sub{return $self -> tag_continue(shift, shift)},
3103 0     0   0 DATA => sub{return $self -> tag_source_citation_data(shift, shift)},
3104 0     0   0 EVEN => sub{return $self -> tag_event_type_cited_from(shift, shift)},
3105 0     0   0 OBJE => sub{return $self -> tag_multimedia_link(shift, shift)},
3106 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3107 0     0   0 PAGE => sub{return $self -> tag_where_within_source(shift, shift)},
3108 0     0   0 QUAY => sub{return $self -> tag_certainty_assessment(shift, shift)},
3109 0     0   0 TEXT => sub{return $self -> tag_text_from_source(shift, shift)},
3110             }
3111 2         240 );
3112              
3113             } # End of tag_source_citation.
3114              
3115             # --------------------------------------------------
3116              
3117             sub tag_source_citation_data
3118             {
3119 0     0 0 0 my($self, $index, $line) = @_;
3120 0         0 my($id) = $self -> get_sub_name(caller 0);
3121              
3122 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3123 0         0 $self -> push_item($$line[$index], 'Source');
3124              
3125             return $self -> tag_advance
3126             (
3127             $id,
3128             ++$index,
3129             $line,
3130             {
3131 0     0   0 DATE => sub{return $self -> tag_entry_recording_date(shift, shift)},
3132 0     0   0 TEXT => sub{return $self -> tag_text_from_source(shift, shift)},
3133             }
3134 0         0 );
3135              
3136             } # End of tag_source_citation_data.
3137              
3138             # --------------------------------------------------
3139              
3140             sub tag_source_data
3141             {
3142 0     0 0 0 my($self, $index, $line) = @_;
3143 0         0 my($id) = $self -> get_sub_name(caller 0);
3144              
3145 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3146 0         0 $self -> push_item($$line[$index], 'Source');
3147              
3148             return $self -> tag_advance
3149             (
3150             $id,
3151             ++$index,
3152             $line,
3153             {
3154 0     0   0 AGNC => sub{return $self -> tag_responsible_agency(shift, shift)},
3155 0     0   0 EVEN => sub{return $self -> tag_events_recorded(shift, shift)},
3156 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3157             }
3158 0         0 );
3159              
3160             } # End of tag_source_data.
3161              
3162             # --------------------------------------------------
3163              
3164             sub tag_source_descriptive_title
3165             {
3166 0     0 0 0 my($self, $index, $line) = @_;
3167 0         0 my($id) = $self -> get_sub_name(caller 0);
3168              
3169 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3170 0         0 $self -> check_length($id, $$line[$index]);
3171 0         0 $self -> push_item($$line[$index], 'Source');
3172              
3173             return $self -> tag_advance
3174             (
3175             $id,
3176             ++$index,
3177             $line,
3178             {
3179 0     0   0 CONC => sub{return $self -> tag_concat(shift, shift)},
3180 0     0   0 CONT => sub{return $self -> tag_continue(shift, shift)},
3181             }
3182 0         0 );
3183              
3184             } # End of tag_source_descriptive_title.
3185              
3186             # --------------------------------------------------
3187              
3188             sub tag_source_filed_by_entry
3189             {
3190 0     0 0 0 my($self, $index, $line) = @_;
3191 0         0 my($id) = $self -> get_sub_name(caller 0);
3192              
3193 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3194 0         0 $self -> check_length($id, $$line[$index]);
3195 0         0 $self -> push_item($$line[$index], 'Source');
3196              
3197 0         0 return ++$index;
3198              
3199             } # End of tag_source_filed_by_entry.
3200              
3201             # --------------------------------------------------
3202              
3203             sub tag_source_jurisdiction_place
3204             {
3205 0     0 0 0 my($self, $index, $line) = @_;
3206 0         0 my($id) = $self -> get_sub_name(caller 0);
3207              
3208 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3209 0         0 $self -> check_length($id, $$line[$index]);
3210 0         0 $self -> push_item($$line[$index], 'Source');
3211              
3212 0         0 return ++$index;
3213              
3214             } # End of tag_source_jurisdiction_place.
3215              
3216             # --------------------------------------------------
3217              
3218             sub tag_source_media_type
3219             {
3220 0     0 0 0 my($self, $index, $line) = @_;
3221 0         0 my($id) = $self -> get_sub_name(caller 0);
3222              
3223 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3224 0         0 $self -> check_length($id, $$line[$index]);
3225 0         0 $self -> push_item($$line[$index], 'Source');
3226              
3227 0         0 return ++$index;
3228              
3229             } # End of tag_source_media_type.
3230              
3231             # --------------------------------------------------
3232              
3233             sub tag_source_originator
3234             {
3235 1     1 0 3 my($self, $index, $line) = @_;
3236 1         9 my($id) = $self -> get_sub_name(caller 0);
3237              
3238 1         8 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3239 1         10 $self -> check_length($id, $$line[$index]);
3240 1         4 $self -> push_item($$line[$index], 'Source');
3241              
3242             return $self -> tag_advance
3243             (
3244             $id,
3245             ++$index,
3246             $line,
3247             {
3248 0     0   0 CONC => sub{return $self -> tag_concat(shift, shift)},
3249 0     0   0 CONT => sub{return $self -> tag_continue(shift, shift)},
3250             }
3251 1         115 );
3252              
3253             } # End of tag_source_originator.
3254              
3255             # --------------------------------------------------
3256              
3257             sub tag_source_publication_date
3258             {
3259 0     0 0 0 my($self, $index, $line) = @_;
3260 0         0 my($id) = $self -> get_sub_name(caller 0);
3261              
3262 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3263 0         0 $self -> push_item($$line[$index], 'Source');
3264              
3265 0         0 return ++$index;
3266              
3267             } # End of tag_source_publication_date.
3268              
3269             # --------------------------------------------------
3270              
3271             sub tag_source_publication_facts
3272             {
3273 1     1 0 2 my($self, $index, $line) = @_;
3274 1         8 my($id) = $self -> get_sub_name(caller 0);
3275              
3276 1         8 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3277 1         11 $self -> check_length($id, $$line[$index]);
3278 1         3 $self -> push_item($$line[$index], 'Source');
3279              
3280             return $self -> tag_advance
3281             (
3282             $id,
3283             ++$index,
3284             $line,
3285             {
3286 0     0   0 CONC => sub{return $self -> tag_concat(shift, shift)},
3287 0     0   0 CONT => sub{return $self -> tag_continue(shift, shift)},
3288             }
3289 1         109 );
3290              
3291             } # End of tag_source_publication_facts.
3292              
3293             # --------------------------------------------------
3294              
3295             sub tag_source_record
3296             {
3297 2     2 0 5 my($self, $index, $line) = @_;
3298 2         16 my($id) = $self -> get_sub_name(caller 0);
3299              
3300 2         15 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3301 2         19 $self -> push_item($$line[$index], 'Source');
3302              
3303             return $self -> tag_advance
3304             (
3305             $id,
3306             ++$index,
3307             $line,
3308             {
3309 0     0   0 ABBR => sub{return $self -> tag_source_filed_by_entry(shift, shift)},
3310 1     1   5 AUTH => sub{return $self -> tag_source_originator(shift, shift)},
3311 0     0   0 CHAN => sub{return $self -> tag_change_date1(shift, shift)},
3312 1     1   5 DATA => sub{return $self -> tag_source_record_data(shift, shift)},
3313 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3314 0     0   0 OBJE => sub{return $self -> tag_multimedia_link(shift, shift)},
3315 1     1   5 PUBL => sub{return $self -> tag_source_publication_facts(shift, shift)},
3316 0     0   0 REFN => sub{return $self -> tag_user_reference_number(shift, shift)},
3317 0     0   0 RIN => sub{return $self -> tag_automated_record_id(shift, shift)},
3318 0     0   0 REPO => sub{return $self -> tag_source_repository_citation(shift, shift)},
3319 0     0   0 TEXT => sub{return $self -> tag_text_from_source(shift, shift)},
3320 0     0   0 TITL => sub{return $self -> tag_source_descriptive_title(shift, shift)},
3321             }
3322 2         250 );
3323              
3324             } # End of tag_source_record.
3325              
3326             # --------------------------------------------------
3327              
3328             sub tag_source_record_data
3329             {
3330 1     1 0 3 my($self, $index, $line) = @_;
3331 1         9 my($id) = $self -> get_sub_name(caller 0);
3332              
3333 1         8 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3334 1         14 $self -> push_item($$line[$index], 'Source');
3335              
3336             return $self -> tag_advance
3337             (
3338             $id,
3339             ++$index,
3340             $line,
3341             {
3342 0     0   0 AGNC => sub{return $self -> tag_responsible_agency(shift, shift)},
3343 1     1   7 EVEN => sub{return $self -> tag_events_recorded(shift, shift)},
3344 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3345             }
3346 1         114 );
3347              
3348             } # End of tag_source_record_data.
3349              
3350             # --------------------------------------------------
3351              
3352             sub tag_spouse_to_family_link
3353             {
3354 240     240 0 526 my($self, $index, $line) = @_;
3355 240         2063 my($id) = $self -> get_sub_name(caller 0);
3356              
3357 240         1526 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3358 240         2131 $self -> push_item($$line[$index], 'Link to FAM');
3359              
3360             return $self -> tag_advance
3361             (
3362             $id,
3363             ++$index,
3364             $line,
3365             {
3366 126     126   613 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3367             }
3368 240         26712 );
3369              
3370             } # End of tag_spouse_to_family_link.
3371              
3372             # --------------------------------------------------
3373              
3374             sub tag_submission_record
3375             {
3376 0     0 0 0 my($self, $index, $line) = @_;
3377 0         0 my($id) = $self -> get_sub_name(caller 0);
3378              
3379 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3380 0         0 $self -> push_item($$line[$index], 'Link to SUBM');
3381              
3382             return $self -> tag_advance
3383             (
3384             $id,
3385             ++$index,
3386             $line,
3387             {
3388 0     0   0 ANCE => sub{return $self -> tag_generations_of_ancestors(shift, shift)},
3389 0     0   0 DESC => sub{return $self -> tag_generations_of_descendants(shift, shift)},
3390 0     0   0 FAMF => sub{return $self -> tag_name_of_family_file(shift, shift)},
3391 0     0   0 ORDI => sub{return $self -> tag_ordinance_process_flag(shift, shift)},
3392 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3393 0     0   0 RIN => sub{return $self -> tag_rin(shift, shift)},
3394 0     0   0 SUBM => sub{return $self -> tag_submitter_xref(shift, shift)},
3395 0     0   0 TEMP => sub{return $self -> tag_temple_code(shift, shift)},
3396             }
3397 0         0 );
3398              
3399             } # End of tag_submission_record.
3400              
3401             # --------------------------------------------------
3402              
3403             sub tag_submission_repository_citation
3404             {
3405 0     0 0 0 my($self, $index, $line) = @_;
3406 0         0 my($id) = $self -> get_sub_name(caller 0);
3407              
3408 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3409 0         0 $self -> push_item($$line[$index], 'Submission');
3410              
3411             return $self -> tag_advance
3412             (
3413             $id,
3414             ++$index,
3415             $line,
3416             {
3417 0     0   0 CALN => sub{return $self -> tag_source_call_number(shift, shift)},
3418 0     0   0 MEDI => sub{return $self -> tag_source_media_type(shift, shift)},
3419 0     0   0 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3420             }
3421 0         0 );
3422              
3423             } # End of tag_submission_repository_citation.
3424              
3425             # --------------------------------------------------
3426              
3427             sub tag_submission_xref
3428             {
3429 0     0 0 0 my($self, $index, $line) = @_;
3430 0         0 my($id) = $self -> get_sub_name(caller 0);
3431              
3432 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3433 0         0 $self -> push_item($$line[$index], 'Submission');
3434              
3435 0         0 return ++$index;
3436              
3437             } # End of tag_submission_xref.
3438              
3439             # --------------------------------------------------
3440              
3441             sub tag_submitter_record
3442             {
3443 2     2 0 6 my($self, $index, $line) = @_;
3444 2         24 my($id) = $self -> get_sub_name(caller 0);
3445              
3446 2         16 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3447 2         19 $self -> push_item($$line[$index], 'Submitter');
3448              
3449             return $self -> tag_advance
3450             (
3451             $id,
3452             ++$index,
3453             $line,
3454             {
3455 0     0   0 CHAN => sub{return $self -> tag_change_date1(shift, shift)},
3456 0     0   0 LANG => sub{return $self -> tag_language_preference(shift, shift)},
3457 2     2   10 NAME => sub{return $self -> tag_submitter_name(shift, shift)},
3458 2     2   14 NOTE => sub{return $self -> tag_note_structure(shift, shift)},
3459 0     0   0 OBJE => sub{return $self -> tag_multimedia_link(shift, shift)},
3460 0     0   0 RFN => sub{return $self -> tag_submitter_registered_rfn(shift, shift)},
3461 0     0   0 RIN => sub{return $self -> tag_rin(shift, shift)},
3462 2         307 $self -> tag_address_structure_tags,
3463             }
3464             );
3465              
3466             } # End of tag_submitter_record.
3467              
3468             # --------------------------------------------------
3469              
3470             sub tag_submitter_registered_rfn
3471             {
3472 0     0 0 0 my($self, $index, $line) = @_;
3473 0         0 my($id) = $self -> get_sub_name(caller 0);
3474              
3475 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3476 0         0 $self -> check_length($id, $$line[$index]);
3477 0         0 $self -> push_item($$line[$index], 'Submitter');
3478              
3479 0         0 return ++$index;
3480              
3481             } # End of tag_rfn.
3482              
3483             # --------------------------------------------------
3484              
3485             sub tag_submitter_name
3486             {
3487 2     2 0 5 my($self, $index, $line) = @_;
3488 2         19 my($id) = $self -> get_sub_name(caller 0);
3489              
3490 2         17 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3491 2         22 $self -> check_length($id, $$line[$index]);
3492 2         7 $self -> push_item($$line[$index], 'Submission');
3493              
3494 2         240 return ++$index;
3495              
3496             } # End of tag_submitter_name.
3497              
3498             # --------------------------------------------------
3499              
3500             sub tag_submitter_xref
3501             {
3502 4     4 0 9 my($self, $index, $line) = @_;
3503 4         35 my($id) = $self -> get_sub_name(caller 0);
3504              
3505 4         31 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3506 4         39 $self -> push_item($$line[$index], 'Submission');
3507              
3508 4         553 return ++$index;
3509              
3510             } # End of tag_submitter_xref.
3511              
3512             # --------------------------------------------------
3513              
3514             sub tag_temple_code
3515             {
3516 0     0 0 0 my($self, $index, $line) = @_;
3517 0         0 my($id) = $self -> get_sub_name(caller 0);
3518              
3519 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3520 0         0 $self -> check_length($id, $$line[$index]);
3521 0         0 $self -> push_item($$line[$index], '');
3522              
3523 0         0 return ++$index;
3524              
3525             } # End of tag_temple_code.
3526              
3527             # --------------------------------------------------
3528              
3529             sub tag_text_from_source
3530             {
3531 0     0 0 0 my($self, $index, $line) = @_;
3532 0         0 my($id) = $self -> get_sub_name(caller 0);
3533              
3534 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3535 0         0 $self -> check_length($id, $$line[$index]);
3536 0         0 $self -> push_item($$line[$index], '');
3537              
3538             return $self -> tag_advance
3539             (
3540             $id,
3541             ++$index,
3542             $line,
3543             {
3544 0     0   0 CONC => sub{return $self -> tag_concat(shift, shift)},
3545 0     0   0 CONT => sub{return $self -> tag_continue(shift, shift)},
3546             }
3547 0         0 );
3548              
3549             } # End of tag_text_from_source.
3550              
3551             # --------------------------------------------------
3552              
3553             sub tag_time_value
3554             {
3555 2     2 0 4 my($self, $index, $line) = @_;
3556 2         28 my($id) = $self -> get_sub_name(caller 0);
3557              
3558 2         17 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3559 2         25 $self -> check_length($id, $$line[$index]);
3560 2         7 $self -> push_item($$line[$index], '');
3561              
3562 2         225 return ++$index;
3563              
3564             } # End of tag_time_value.
3565              
3566             # --------------------------------------------------
3567              
3568             sub tag_trailer
3569             {
3570 7     7 0 15 my($self, $index, $line) = @_;
3571 7         63 my($id) = $self -> get_sub_name(caller 0);
3572              
3573 7         51 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3574 7 50       79 $self -> log(warning => "Line: $$line[$index][0]. The unknown tag $$line[$index][3] was detected") if ($$line[$index][3] ne 'TRLR');
3575 7         19 $self -> push_item($$line[$index], 'Trailer');
3576              
3577 7         863 return ++$index;
3578              
3579             } # End of tag_trailer.
3580              
3581             # --------------------------------------------------
3582              
3583             sub tag_transmission_date
3584             {
3585 6     6 0 15 my($self, $index, $line) = @_;
3586 6         55 my($id) = $self -> get_sub_name(caller 0);
3587              
3588 6         44 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3589 6         65 $self -> check_exact_date($id, $$line[$index]);
3590              
3591             return $self -> tag_advance
3592             (
3593             $id,
3594             ++$index,
3595             $line,
3596             {
3597 2     2   14 TIME => sub{return $self -> tag_time_value(shift, shift)},
3598             }
3599 6         989 );
3600              
3601             } # End of tag_transmission_date.
3602              
3603             # --------------------------------------------------
3604              
3605             sub tag_user_reference_number
3606             {
3607 0     0 0 0 my($self, $index, $line) = @_;
3608 0         0 my($id) = $self -> get_sub_name(caller 0);
3609              
3610 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3611 0         0 $self -> check_length($id, $$line[$index]);
3612 0         0 $self -> push_item($$line[$index], '');
3613              
3614             return $self -> tag_advance
3615             (
3616             $id,
3617             ++$index,
3618             $line,
3619             {
3620 0     0   0 TYPE => sub{return $self -> tag_user_reference_type(shift, shift)},
3621             }
3622 0         0 );
3623              
3624             } # End of tag_user_reference_number.
3625              
3626             # --------------------------------------------------
3627              
3628             sub tag_user_reference_type
3629             {
3630 0     0 0 0 my($self, $index, $line) = @_;
3631 0         0 my($id) = $self -> get_sub_name(caller 0);
3632              
3633 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3634 0         0 $self -> check_length($id, $$line[$index]);
3635 0         0 $self -> push_item($$line[$index], '');
3636              
3637 0         0 return ++$index;
3638              
3639             } # End of tag_user_reference_type.
3640              
3641             # --------------------------------------------------
3642              
3643             sub tag_version_number
3644             {
3645 12     12 0 28 my($self, $index, $line) = @_;
3646 12         116 my($id) = $self -> get_sub_name(caller 0);
3647              
3648 12         111 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3649 12         145 $self -> check_length($id, $$line[$index]);
3650 12         50 $self -> push_item($$line[$index], '');
3651              
3652 12         1897 return ++$index;
3653              
3654             } # End of tag_version_number.
3655              
3656             # --------------------------------------------------
3657              
3658             sub tag_where_within_source
3659             {
3660 0     0 0 0 my($self, $index, $line) = @_;
3661 0         0 my($id) = $self -> get_sub_name(caller 0);
3662              
3663 0         0 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3664 0         0 $self -> check_length($id, $$line[$index]);
3665 0         0 $self -> push_item($$line[$index], 'Source');
3666              
3667 0         0 return ++$index;
3668              
3669             } # End of tag_page.
3670              
3671             # --------------------------------------------------
3672              
3673             sub tag_wife_xref
3674             {
3675 117     117 0 236 my($self, $index, $line) = @_;
3676 117         866 my($id) = $self -> get_sub_name(caller 0);
3677              
3678 117         779 $self -> log(debug => "$id($$line[$index][0], '$$line[$index][5]')");
3679 117         1020 $self -> push_item($$line[$index], 'Link to INDI');
3680              
3681 117         13261 return ++$index;
3682              
3683             } # End of tag_wife_xref.
3684              
3685             # --------------------------------------------------
3686              
3687             1;
3688              
3689             =pod
3690              
3691             =head1 NAME
3692              
3693             L - An OS-independent lexer for GEDCOM data
3694              
3695             =head1 Synopsis
3696              
3697             Run scripts/lex.pl -help.
3698              
3699             A typical run would be:
3700              
3701             perl -Ilib scripts/lex.pl -i data/royal.ged -r 1 -s 1
3702              
3703             Turn on debugging prints with:
3704              
3705             perl -Ilib scripts/lex.pl -i data/royal.ged -r 1 -s 1 -max debug
3706              
3707             royal.ged was downloaded from L. It's more up-to-date than the one shipped with L.
3708              
3709             Various sample GEDCOM files may be found in the data/ directory in the distro.
3710              
3711             =head1 Description
3712              
3713             L provides a lexer for GEDCOM data.
3714              
3715             See L.
3716              
3717             =head1 Installation
3718              
3719             Install L as you would for any C module:
3720              
3721             Run:
3722              
3723             cpanm Genealogy::Gedcom
3724              
3725             or run:
3726              
3727             sudo cpan Genealogy::Gedcom
3728              
3729             or unpack the distro, and then either:
3730              
3731             perl Build.PL
3732             ./Build
3733             ./Build test
3734             sudo ./Build install
3735              
3736             or:
3737              
3738             perl Makefile.PL
3739             make (or dmake or nmake)
3740             make test
3741             make install
3742              
3743             =head1 Constructor and Initialization
3744              
3745             C is called as C<< my($lexer) = Genealogy::Gedcom::Reader::Lexer -> new(k1 => v1, k2 => v2, ...) >>.
3746              
3747             It returns a new object of type C.
3748              
3749             Key-value pairs accepted in the parameter list (see corresponding methods for details [e.g. input_file()]):
3750              
3751             =over 4
3752              
3753             =item o input_file => $gedcom_file_name
3754              
3755             Read the GEDCOM data from this file.
3756              
3757             Default: ''.
3758              
3759             =item o logger => $logger_object
3760              
3761             Specify a logger object.
3762              
3763             To disable logging, just set logger to the empty string.
3764              
3765             Default: An object of type L.
3766              
3767             =item o maxlevel => $level
3768              
3769             This option is only used if the lexer creates an object of type L. See L.
3770              
3771             Default: 'info'.
3772              
3773             Log levels are, from highest (i.e. most output) to lowest: 'debug', 'info', 'warning', 'error'. No lower levels are used.
3774              
3775             =item o minlevel => $level
3776              
3777             This option is only used if the lexer creates an object of type L. See L.
3778              
3779             Default: 'error'.
3780              
3781             =item o report_items => $Boolean
3782              
3783             =over 4
3784              
3785             =item o 0 => Report nothing
3786              
3787             =item o 1 => Call L to report, via the log, the items recognized by the lexer
3788              
3789             This output is at log level 'info'.
3790              
3791             =back
3792              
3793             Default: 0.
3794              
3795             =item o strict => $Boolean
3796              
3797             Specifies lax or strict string length checking during validation.
3798              
3799             =over 4
3800              
3801             =item o 0 => String lengths can be 0, allowing blank NOTE etc records
3802              
3803             =item o 1 => String lengths must be > 0, as per the GEDCOM Specification
3804              
3805             Note: A string of length 1 - e.g. '0' - might still be an error.
3806              
3807             =back
3808              
3809             Default: 0.
3810              
3811             The upper lengths on strings are always as per the GEDCOM Specification.
3812             See L for details.
3813              
3814             String lengths out of range (as with all validation failures) are reported as log messages at level 'warning'.
3815              
3816             =back
3817              
3818             =head1 Methods
3819              
3820             =head2 check_date($id, $line)
3821              
3822             Checks the date field in the input arrayref $line, $$line[4].
3823              
3824             $id identifies what type of record the $line is expected to be.
3825              
3826             =head2 check_length($id, $line)
3827              
3828             Checks the length of the data component (after the tag) on the input arrayref $line, $$line[4].
3829              
3830             $id identifies what type of record the $line is expected to be.
3831              
3832             =head2 cross_check_xrefs
3833              
3834             Ensure that all xrefs point to existing records.
3835              
3836             See L for details.
3837              
3838             =head2 get_gedcom_from_file()
3839              
3840             If the caller has requested GEDCOM data be read from a file, with the input_file option to new(), this method reads that file.
3841              
3842             Called as appropriate by L, if you do not suppy data with L.
3843              
3844             =head2 gedcom_data([$gedcom_data])
3845              
3846             The [] indicate an optional parameter.
3847              
3848             Get or set the arrayref of GEDCOM records to be processed.
3849              
3850             This is normally only used internally, but can be used to bypass reading from a file.
3851              
3852             Note: If supplying data this way rather than via the file, you must strip newlines etc on every line, as well as leading and trailing blanks.
3853              
3854             =head2 get_max_length($id, $line)
3855              
3856             Get the maximum string length of the data component (after the tag) on the given $line.
3857              
3858             $id identifies what type of record the $line is expected to be.
3859              
3860             =head2 get_min_length($id, $line)
3861              
3862             Get the minimum string length of the data component (after the tag) on the given $line.
3863              
3864             Currently, this value is actually the value of strict(), i.e. 0 or 1.
3865              
3866             $id identifies what type of record the $line is expected to be.
3867              
3868             =head2 input_file([$gedcom_file_name])
3869              
3870             Here, the [] indicate an optional parameter.
3871              
3872             Get or set the name of the file to read the GEDCOM data from.
3873              
3874             =head2 items()
3875              
3876             Returns a object of type L, which is an arrayref of items output by the lexer.
3877              
3878             See the L for details.
3879              
3880             =head2 log($level, $s)
3881              
3882             Calls $self -> logger -> $level($s).
3883              
3884             =head2 logger([$logger_object])
3885              
3886             Here, the [] indicate an optional parameter.
3887              
3888             Get or set the logger object.
3889              
3890             To disable logging, just set logger to the empty string.
3891              
3892             =head2 maxlevel([$string])
3893              
3894             Here, the [] indicate an optional parameter.
3895              
3896             Get or set the value used by the logger object.
3897              
3898             This option is only used if the lexer creates an object of type L. See L.
3899              
3900             =head2 minlevel([$string])
3901              
3902             Here, the [] indicate an optional parameter.
3903              
3904             Get or set the value used by the logger object.
3905              
3906             This option is only used if the lexer creates an object of type L. See L.
3907              
3908             =head2 push_item($line, $type)
3909              
3910             Pushes a hashref of components of the $line, with type $type, onto the arrayref of items returned by L.
3911              
3912             See the L for details.
3913              
3914             =head2 renumber_items()
3915              
3916             Scan the arrayref of hashrefs returned by items() and ensure the 'count' field is ok.
3917              
3918             This is done in case array elements have been combined, e.g. when processing CONCs and CONTs for NOTEs.
3919              
3920             =head2 report()
3921              
3922             Report, via the log, the list of items recognized by the lexer.
3923              
3924             =head2 report_items([0 or 1])
3925              
3926             The [] indicate an optional parameter.
3927              
3928             Get or set the value which determines whether or not to report the items recognised by the lexer.
3929              
3930             =head2 run()
3931              
3932             This is the only method the caller needs to call. All parameters are supplied to new(), or via previous calls to various methods.
3933              
3934             Returns 0 for success and 1 for failure.
3935              
3936             =head2 strict([0 or 1])
3937              
3938             The [] indicate an optional parameter.
3939              
3940             Get or set the value which determines whether or not to use 0 or 1 as the minimum string length.
3941              
3942             =head1 FAQ
3943              
3944             =head2 Does this module handle utf8?
3945              
3946             Yes. The input files are assumed to be in utf8. Files in IOS-8859-1 work automatically, too.
3947              
3948             The default output log also handles utf8.
3949              
3950             =head2 How are user-defined tags handled?
3951              
3952             In the same way as GEDCOM tags.
3953              
3954             They are defined by having a leading '_', as well as same syntax as GEDCOM files. That is:
3955              
3956             =over 4
3957              
3958             =item o At level 0, they match /(_?(?:[A-Z]{3,4}))/.
3959              
3960             =item o At level > 0, they match /(_?(?:ADR[123]|[A-Z]{3,5}))/.
3961              
3962             =back
3963              
3964             Each user-defined tag is stand-alone, meaning they can't be extended with CONC or CONT tags in the way some GEDCOM tags can.
3965              
3966             See data/sample.4.ged.
3967              
3968             =head2 How are CONC and CONT tags handled?
3969              
3970             Nothing is done with them, meaning e.g. text flowing from a NOTE (say) onto a CONC or CONT is not concatenated.
3971              
3972             Currently then, even GEDCOM tags are stand-alone.
3973              
3974             =head2 How is the lexed data stored in RAM?
3975              
3976             Items are stored in an arrayref. This arrayref is available via the L method.
3977              
3978             This method returns the same data as does L.
3979              
3980             Each element in the array is a hashref of the form:
3981              
3982             {
3983             count => $n,
3984             data => $a_string
3985             level => $n,
3986             line_count => $n,
3987             tag => $a_tag,
3988             type => $a_string,
3989             xref => $a_string,
3990             }
3991              
3992             Key-value pairs are:
3993              
3994             =over 4
3995              
3996             =item o count => $n
3997              
3998             Items are numbered from 1 up, so this is the array index + 1.
3999              
4000             Note: Blank lines in the input file are skipped.
4001              
4002             =item o data => $a_string
4003              
4004             This is any data associated with the tag.
4005              
4006             Given the GEDCOM record:
4007              
4008             1 NAME Given Name /Surname/
4009              
4010             then data will be 'Given Name /Surname/', i.e. the text after the tag.
4011              
4012             Given the GEDCOM record:
4013              
4014             1 SUBM @SUBM1@
4015              
4016             then data will be 'SUBM1'.
4017              
4018             As with xref (below), the '@' characters are stripped.
4019              
4020             =item o level => $n
4021              
4022             The is the level from the GEDCOM data.
4023              
4024             =item o line_count => $n
4025              
4026             This is the line number from the GEDCOM data.
4027              
4028             =item o tag => $a_tag
4029              
4030             This is the GEDCOM tag.
4031              
4032             =item o type => $a_string
4033              
4034             This is a string indicating what broad class the tag refers to. Values:
4035              
4036             =over 4
4037              
4038             =item o (Empty string)
4039              
4040             Used for various cases.
4041              
4042             =item o Address
4043              
4044             =item o Concat
4045              
4046             =item o Continue
4047              
4048             =item o Date
4049              
4050             If the type is 'Date', then it has been successfully parsed.
4051              
4052             If parsing failed, the value will be 'Invalid date'.
4053              
4054             =item o Event
4055              
4056             =item o Family
4057              
4058             =item o File name
4059              
4060             =item o Header
4061              
4062             =item o Individual
4063              
4064             =item o Invalid date
4065              
4066             If the type is 'Date', then it has been successfully parsed.
4067              
4068             If parsing failed, the value will be 'Invalid date'.
4069              
4070             =item o Link to FAM
4071              
4072             =item o Link to INDI
4073              
4074             =item o Link to OBJE
4075              
4076             =item o Link to SUBM
4077              
4078             =item o Multimedia
4079              
4080             =item o Note
4081              
4082             =item o Place
4083              
4084             =item o Repository
4085              
4086             =item o Source
4087              
4088             =item o Submission
4089              
4090             =item o Submitter
4091              
4092             =item o Trailer
4093              
4094             =back
4095              
4096             =item o xref => $a_string
4097              
4098             Given the GEDCOM record:
4099              
4100             0 @I82@ INDI
4101              
4102             then xref will be 'I82'.
4103              
4104             As with data (above), the '@' characters are stripped.
4105              
4106             =back
4107              
4108             =head2 What validation is performed?
4109              
4110             There is no perfect answer as to what should be a warning and what should be an error.
4111              
4112             So, the author's philosophy is that unrecoverable states are errors, and the code calls 'die'. See L.
4113              
4114             And, the log level 'error' is not used. All validation failures are logged at level warning, leaving interpretation up to the user. See L.
4115              
4116             Details:
4117              
4118             =over 4
4119              
4120             =item o Cross-references
4121              
4122             Xrefs (pointers) are checked that they point to an xref which exists. Each dangling xref is only reported once.
4123              
4124             =item o Dates are validated
4125              
4126             =item o Duplicate xrefs
4127              
4128             Xrefs which are (potentially) pointed to are checked for uniqueness.
4129              
4130             =item o String lengths
4131              
4132             Maximum string lengths are checked as per the GEDCOM Specification.
4133              
4134             Minimum string lengths are checked as per the value of the 'strict' option to L.
4135              
4136             =item o Strict 'v' Mandatory
4137              
4138             Validation is mandatory, even with the 'strict' option set to 0. 'strict' only affects the minimum string length acceptable.
4139              
4140             =item o Tag nesting
4141              
4142             Tag nesting is validated by the mechanism of nested method calls, with each method (called tag_*) knowing what tags it handles, and with each nested call handling its own tags.
4143              
4144             This process starts with the call to tag_lineage(0, $line) in method L.
4145              
4146             =item o Unexpected tags
4147              
4148             The lexer reports the first unexpected tag, meaning it is not a GEDCOM tag and it does not start with '_'.
4149              
4150             =back
4151              
4152             All validation failures are reported as log messages at level 'warning'.
4153              
4154             =head2 What other validation is planned?
4155              
4156             Here are some suggestions from L:
4157              
4158             =over 4
4159              
4160             =item o Mandatory sub-tags
4161              
4162             This means check that each tag has all its mandatory sub-tags.
4163              
4164             =item o Natural (not step-) parent must be older than child
4165              
4166             =item o Prior art
4167              
4168             L.
4169              
4170             =item o Specific values for data attached to tags
4171              
4172             Many such checks are possible. E.g. Attribute type (p 43 of L)
4173             must be one of: CAST | EDUC | NATI | OCCU | PROP | RELI | RESI | TITL | FACT.
4174              
4175             =back
4176              
4177             =head2 What other features are planned?
4178              
4179             Here are some suggestions from L:
4180              
4181             =over 4
4182              
4183             =item o Persistent IDs for individuals
4184              
4185             L.
4186              
4187             =back
4188              
4189             =head2 How does logging work?
4190              
4191             =over 4
4192              
4193             =item o Debugging
4194              
4195             When new() is called as new(maxlevel => 'debug'), each method entry is logged at level 'debug'.
4196              
4197             This has the effect of tracing all code which processes tags.
4198              
4199             Since the default value of 'maxlevel' is 'info', all this output is suppressed by default. Such output is mainly for the author's benefit.
4200              
4201             =item o Log levels
4202              
4203             Log levels are, from highest (i.e. most output) to lowest: 'debug', 'info', 'warning', 'error'. No lower levels are used. See L.
4204              
4205             'maxlevel' defaults to 'info' and 'minlevel' defaults to 'error'. In this way, levels 'info' and 'warning' are reported by default.
4206              
4207             Currently, level 'error' is not used. Fatal errors cause 'die' to be called, since they are unrecoverable. See L.
4208              
4209             =item o Reporting
4210              
4211             When new() is called as new(report_items => 1), the items are logged at level 'info'.
4212              
4213             =item o Validation failures
4214              
4215             These are reported at level 'warning'.
4216              
4217             =back
4218              
4219             =head2 Under what circumstances does the code call 'die'?
4220              
4221             =over 4
4222              
4223             =item o When there is a typo in the field name passed in to check_length()
4224              
4225             This is a programming error.
4226              
4227             =item o When an input file is not specified
4228              
4229             This is a user (run time) error.
4230              
4231             =item o When there is a syntax error in a GEDCOM record
4232              
4233             This is a user (data preparation) error.
4234              
4235             =back
4236              
4237             =head2 How do I change the version of the GEDCOM grammar supported?
4238              
4239             By sub-classing.
4240              
4241             =head1 TODO
4242              
4243             =over 4
4244              
4245             =item o Support ANSEL
4246              
4247             =item o Tighten validation
4248              
4249             =back
4250              
4251             =head1 Repository
4252              
4253             L
4254              
4255             =head1 See Also
4256              
4257             L.
4258              
4259             .
4260              
4261             =head1 Machine-Readable Change Log
4262              
4263             The file Changes was converted into Changelog.ini by L.
4264              
4265             =head1 Version Numbers
4266              
4267             Version numbers < 1.00 represent development versions. From 1.00 up, they are production versions.
4268              
4269             =head1 References
4270              
4271             =over 4
4272              
4273             =item o The original Perl L
4274              
4275             =item o GEDCOM
4276              
4277             =over 4
4278              
4279             =item o L
4280              
4281             =item o L
4282              
4283             =item o L
4284              
4285             =back
4286              
4287             =item o Usage of non-standard tags
4288              
4289             =over 4
4290              
4291             =item o L
4292              
4293             This is apparently the worst offender he's seen. Search that page for 'tags'.
4294              
4295             =item o L
4296              
4297             =item o L
4298              
4299             =item o L
4300              
4301             =back
4302              
4303             =item o Other articles on Tamura's site
4304              
4305             =over 4
4306              
4307             =item o L
4308              
4309             =item o L
4310              
4311             =back
4312              
4313             =item o Other projects
4314              
4315             Many of these are discussed on Tamura's site.
4316              
4317             =over 4
4318              
4319             =item o L
4320              
4321             =item o L
4322              
4323             =item o L
4324              
4325             =item o L
4326              
4327             =item o L
4328              
4329             =item o L
4330              
4331             =item o L
4332              
4333             =item o L
4334              
4335             =item o L
4336              
4337             =item o L
4338              
4339             =item o L
4340              
4341             =item o L
4342              
4343             =back
4344              
4345             =back
4346              
4347             =head1 The Gedcom Mailing List
4348              
4349             Contact perl-gedcom-help@perl.org.
4350              
4351             =head1 Support
4352              
4353             Email the author, or log a bug on RT:
4354              
4355             L.
4356              
4357             =head1 Author
4358              
4359             L was written by Ron Savage Iron@savage.net.auE> in 2011.
4360              
4361             Home page: L.
4362              
4363             =head1 Copyright
4364              
4365             Australian copyright (c) 2011, Ron Savage.
4366              
4367             All Programs of mine are 'OSI Certified Open Source Software';
4368             you can redistribute them and/or modify them under the terms of
4369             The Artistic License, a copy of which is available at:
4370             http://www.opensource.org/licenses/index.html
4371