Branch Coverage

File:blib/lib/Genealogy/Obituary/Parser.pm
Coverage:74.0%

line%coveragebranch
11450TFif (my $geo = $params->{'geocoder'})
11850TFunless defined $text
12050TFif (ref $text eq "SCALAR")
1500TFunless $list
16750TFunless $section
180100TFif ($entry =~ /^(\w+)\s+\(([^)]+)\)\s+(\w+)\s+of\s+(.+)$/) { }
100TFelsif ($entry =~ /^(.+?)\s+\(([^)]+)\)\s+of\s+(.+)$/) { }
100TFelsif ($entry =~ /^(.+?)\s+of\s+(.+)$/) { }
195100TFunless $name
196100TFif $name =~ /^father-in-law\sto\s/
197100TFif $name =~ /^devoted\s/i
19850TFif $name =~ /^loved\s/i
20850TFif defined $person{$_}
22250TFif ($phrase =~ /^((?:\w+\s*,\s*)+\w+),?\s*and\s+(\w+)\s+(\w+)$/)
23150TFif ($phrase =~ /^([\w\s]+?)\s+and\s+(\w+)\s+(\w+)$/)
24250TFif ($phrase =~ /(.+?),\s*(\w+)\s+and\s+(\w+)/) { }
24850TFif defined $_
255100TFif ($text =~ /survived by (his|her) children\s*([^\.;]+)/i) { }
100TFelsif ($text =~ /Loving mum to\s*([^\.;]+)/i) { }
100TFelsif ($text =~ /Loving father of\s*([^\.;]+)/i) { }
100TFelsif ($text =~ /mother of\s*([^\.;]+)?,/i) { }
100TFelsif ($text =~ /sons,?\s*([a-z]+)\s+and\s+([a-z]+)/i) { }
50TFelsif ($text =~ /Surviving are (?:a )?daughters?,\s*Mrs\.\s+(\w+)\s+\(([^)]+)\)\s+(\w+),\s+([^;]+?);/i) { }
273100TFif ($text =~ /\bdaughter,?\s([a-z]+)/i)
276100TFif ($text =~ /\bgranddaughter,?\s([a-z]+)/i)
27950TFif @children
280100TFif @grandchildren
306100TFif ($text =~ /\ssons,\s*(.*?);/s)
308100TFif ($sons_text =~ /, all of (.+)$/) { }
312100TFif ($son =~ /(\w+)\s+and\s+(\w+)/) { }
341100TFif ($text =~ /\sdaughters?,\s*Mrs\.\s+(.+?)\s+(\w+),\s+([^;]+)\sand/) { }
100TFelsif ($text =~ /one daughter,\s*(.+?),\s*(.+?);/) { }
35150TFif ($name =~ /(\w+)\s+(\w+)/) { }
366100TFif @children
368100TFunless ($family{'children'})
370100TF$1 eq 'son' ? :
37350TF$grandkids ? :
50TFif (my(@grandchildren) = $grandkids ? split(/\s*,\s*|\s+and\s+/, $grandkids, 0) : ()) { }
100TFelsif ($sex eq 'F' and $child =~ /(.+)\s+\((.+)\)/) { }
50TFelsif ($child ne 'Mrs') { }
386100TFif @children
389100TFunless ($family{'children'})
39050TFif ($text =~ /\ssons?[,\s]\s*(.+?)[;\.]/)
396100TFif ($text =~ /\sdaughters?[,\s]\s*(.+?)[;\.]/)
405100TFunless ($family{'grandchildren'})
406100TFif ($text =~ /grandchildren\s+([^\.;]+)/i)
40850TFif (scalar @grandchildren)
40950TFif defined $_
413100TFif ($family{'grandchildren'} and scalar @{$family{'grandchildren'};}) { }
41750TFif ($family{'grandchildren'}[0] =~ /brothers/)
4180TFunless (exists $family{'brothers'})
427100TFif (not defined $family{'grandchildren'} or $#{$family{"grandchildren"};} <= 0)
432100TFif ($grandchildren_str)
435100TFif (scalar @grandchildren) { }
100TFelsif ($text =~ /grandm\w+\s/) { }
445100TFif ($text =~ /predeceased by (his|her) sisters?\s*([^;\.]+);?/i) { }
453100TFif ($name eq "Mrs")
45450TFif ($text =~ / sister,\s*Mrs\.\s+([A-Z][a-zA-Z]+\s+[A-Z][a-zA-Z]+)/) { }
46050TFif ($name)
46150TF$text =~ /\bpredeceased by.*?$name/i ? :
469100TFunless (exists $family{'sisters'})
470100TFif ($text =~ /\stwo\ssisters,\s*(.*?)\sand\s(.*?)[;:]/s)
47350TFif ($sister =~ /Mrs\.\s(.+?),\s(.+)/) { }
47750TFif ($name =~ /(\w+)\s+(\w+)/) { }
501100TFif ($family{'sisters'})
51350TFif ($text =~ /predeceased by (his|her) brothers?\s*([^;\.]+);?/i) { }
52150TF$text =~ /\bpredeceased by.*?$1/i ? :
52650TFunless ($family{'brothers'} or $family{'sisters'} or $family{'siblings'})
527100TFif ($text =~ /sister of ([a-z]+) and ([a-z]+)/i)
534100TFunless (exists $family{'brothers'})
535100TFif ($text =~ /\sbrothers,\s*(.*?)[;\.]/s)
53750TFif ($brothers_text =~ /, all of (.+)$/) { }
541100TFif ($son =~ /(\w+)\s+and\s+(\w+)/) { }
57350TFif (not exists $family{'brothers'} and $text =~ /\b(?:two|three|four)\s+brothers?,\s*(.+?)(?:,\s*a\s+(?:sister|half-sister)|;)/i)
5790TFif ($brothers_text =~ /\band\b/)
5910TFif scalar @brothers
595100TF$text =~ /as well as several nieces and nephews/i ? :
598100TFif ($text =~ /(son|daughter) of the late\s+(.+?)\s+and\s+(.+?)\./i) { }
100TFelsif ($text =~ /parents were (\w+) and (\w+)/i) { }
60650TFif ($mother =~ /(.+)\s+\((.+)\)\s+(.+)/)
621100TFif ($text =~ /(wife|husband) of the late\s+([\w\s]+)\s+\((\d{4})\)/) { }
100TFelsif ($text =~ /\bmarried ([^,]+),.*?\b(?:on\s+)?([A-Z][a-z]+ \d{1,2}, \d{4})(?:.*?\b(?:at|in)\s+([^.,]+))?/i) { }
100TFelsif ($text =~ /husband (?:to|of) the late\s([\w\s]+)[\s\.]/i) { }
100TFelsif ($text =~ /\b(?:wife|husband) of ([^.,;]+)/i) { }
100TFelsif ($text =~ /\bsurvived by her husband ([^.,;]+)/i) { }
100TFelsif ($text =~ /\bsurvived by his wife[,\s]+([^.,;]+)/i) { }
6620TFif (exists $family{'spouse'} and ref $family{'spouse'} eq "HASH" and defined $family{'spouse'}[0]{'location'} and $family{'spouse'}[0]{'location'} eq "the late")
667100TFif ($text =~ /funeral service.*?at\s+(.+?),?\s+on\s+(.*?),?\s+at\s+(.+?)\./) { }
100TFelsif ($text =~ /funeral service.*?at\s+([^\n]+?)\s+on\s+([^\n]+)\s+at\s+([^\n]+)/i) { }
100TFelsif ($text =~ /funeral services.+\sat\s(.+)\sat\s(.+),\swith\s/i) { }
50TFelsif ($text =~ /funeral services.+\sat\s(.+),\swith\s/i) { }
100TFelsif ($text =~ /services.+\sat\s(.+),\swith\s/i) { }
67950TFif ($family{'funeral'}{'date'} =~ /(.+?)\.\s{2,}/)
68150TFif ($family{'funeral'}{'date'} =~ /(.+?)\sat\s(.+)/)
699100TFif ($text =~ /father-in-law to\s+([A-Za-z\s]+)/) { }
100TFelsif ($text =~ /mother-in-law to\s+([A-Za-z\s]+)/i) { }
70550TFif (scalar($family{'children_in_law'} == 0))
711100TFif ($text =~ /niece of\s+([A-Za-z]+)/)
717100TFif ($text =~ /[^\b]Born in ([^,]+),.*?\b(?:on\s+)?([A-Z][a-z]+ \d{1,2}, \d{4})/i) { }
100TFelsif ($text =~ /[^\b]Born in ([a-z,\.\s]+)\s+on\s+(.+)/i) { }
100TFelsif ($text =~ /S?he was born (.+)\sin ([a-z,\.\s]+)\s+to\s+(.+?)\sand\s(.+?)\./i) { }
100TFelsif ($text =~ /[^\b]S?he was born\s*(?:on\s+)?([A-Z][a-z]+ \d{1,2}, \d{4})[,\s]+(?:in\s+)([^,]+)?/i) { }
72450TFif (my $location = _extract_location($1))
72750TFif (my $dt = _extract_date($2))
73650TFif (my $dt = "DateTime::Format::Text"->parse_datetime($1))
74450TFif ($mother =~ /(.+)\s+\((.+)\)\s+(.+)/)
74750TFif ($father =~ /(.+?)\.\s\s/)
75450TFif ($text =~ /survived by (his|her) (father|mother)[\s,;]/i)
75850TFif (my $dt = _extract_date($1))
76150TFif ($2)
767100TFif ($text =~ /\bpassed away\b.*?\b(?:on\s+)?([A-Z]+ \d{1,2}, \d{4})/i)
76950TFif (my $dt = _extract_date($1))
775100TFif ($text =~ /,\s(\d{1,3}), of\s/)
77650TFif ($1 < 110)
782100TFif ($text =~ /\b(?:passed away|died)\b([a-z0-9\s,]+)\sat\s+(.+?)\./i)
78450TFif ($place =~ /(.+)\s+on\s+([A-Z]+ \d{1,2}, \d{4})/i) { }
100TFelsif ($place =~ /(.+)\son\s(.+)/) { }
78950TFif (my $dt = _extract_date($2))
80050TFif defined $family{$_}
804100TFif (ref $family{$key} eq "ARRAY")
806100TFif (@{$family{$key};} == 0)
81250TFunless scalar keys %family
82450TFif $dt and not $@
83150TFunless ($geocoder)
83350TFif ($@)
8420TFunless scalar @locations
8460TFif (ref $result)