Branch Coverage

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

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
204100TFif defined $spouse and $spouse ne ""
205100TFif defined $location and $location ne ""
21950TFif ($phrase =~ /^((?:\w+\s*,\s*)+\w+),?\s*and\s+(\w+)\s+(\w+)$/)
22850TFif ($phrase =~ /^([\w\s]+?)\s+and\s+(\w+)\s+(\w+)$/)
23950TFif ($phrase =~ /(.+?),\s*(\w+)\s+and\s+(\w+)/) { }
24550TFif defined $_
252100TFif ($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) { }
270100TFif ($text =~ /\bdaughter,?\s([a-z]+)/i)
273100TFif ($text =~ /\bgranddaughter,?\s([a-z]+)/i)
27650TFif @children
277100TFif (@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'})
390100TFif ($text =~ /\ssons?[,\s]\s*(.+?)[;\.]/)
396100TFif ($text =~ /\sdaughters?[,\s]\s*(.+?)[;\.]/)
405100TFunless ($family{'grandchildren'})
406100TFif ($text =~ /grandchildren\s+([^\.;]+)/i)
40850TFif (scalar @grandchildren)
41050TFif defined $_
414100TFif ($family{'grandchildren'} and scalar @{$family{'grandchildren'};}) { }
41850TFif ($family{'grandchildren'}[0] =~ /brothers/)
4190TFunless (exists $family{'brothers'})
428100TFif (not defined $family{'grandchildren'} or $#{$family{"grandchildren"};} <= 0)
433100TFif ($grandchildren_str)
436100TFif (scalar @grandchildren) { }
100TFelsif ($text =~ /grandm\w+\s/) { }
448100TFif ($text =~ /predeceased by (his|her) sisters?\s*([^;\.]+);?/i) { }
456100TFif ($name eq "Mrs")
45750TFif ($text =~ / sister,\s*Mrs\.\s+([A-Z][a-zA-Z]+\s+[A-Z][a-zA-Z]+)/) { }
46350TFif ($name)
46450TF$text =~ /\bpredeceased by.*?$name/i ? :
472100TFunless (exists $family{'sisters'})
473100TFif ($text =~ /\stwo\ssisters,\s*(.*?)\sand\s(.*?)[;:]/s)
47650TFif ($sister =~ /Mrs\.\s(.+?),\s(.+)/) { }
48050TFif ($name =~ /(\w+)\s+(\w+)/) { }
504100TFif ($family{'sisters'})
51650TFif ($text =~ /predeceased by (his|her) brothers?\s*([^;\.]+);?/i) { }
52450TF$text =~ /\bpredeceased by.*?$1/i ? :
52950TFunless ($family{'brothers'} or $family{'sisters'} or $family{'siblings'})
530100TFif ($text =~ /sister of ([a-z]+) and ([a-z]+)/i)
537100TFunless (exists $family{'brothers'})
538100TFif ($text =~ /\sbrothers,\s*(.*?)[;\.]/s)
540100TFif ($brothers_text =~ /, all of (.+)$/) { }
544100TFif ($son =~ /(\w+)\s+and\s+(\w+)/) { }
57650TFif (not exists $family{'brothers'} and $text =~ /\b(?:two|three|four)\s+brothers?,\s*(.+?)(?:,\s*a\s+(?:sister|half-sister)|;)/i)
5820TFif ($brothers_text =~ /\band\b/)
5940TFif scalar @brothers
598100TF$text =~ /as well as several nieces and nephews/i ? :
601100TFif ($text =~ /(son|daughter) of the late\s+(.+?)\s+and\s+(.+?)\./i) { }
100TFelsif ($text =~ /parents were (\w+) and (\w+)/i) { }
60950TFif ($mother =~ /(.+)\s+\((.+)\)\s+(.+)/)
624100TFif ($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) { }
6650TFif (exists $family{'spouse'} and ref $family{'spouse'} eq "HASH" and defined $family{'spouse'}[0]{'location'} and $family{'spouse'}[0]{'location'} eq "the late")
670100TFif ($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) { }
68250TFif ($family{'funeral'}{'date'} =~ /(.+?)\.\s{2,}/)
68450TFif ($family{'funeral'}{'date'} =~ /(.+?)\sat\s(.+)/)
702100TFif ($text =~ /father-in-law to\s+([A-Za-z\s]+)/) { }
100TFelsif ($text =~ /mother-in-law to\s+([A-Za-z\s]+)/i) { }
70850TFif (scalar($family{'children_in_law'} == 0))
714100TFif ($text =~ /niece of\s+([A-Za-z]+)/)
720100TFif ($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) { }
72750TFif (my $location = _extract_location($1))
73050TFif (my $dt = _extract_date($2))
73950TFif (my $dt = "DateTime::Format::Text"->parse_datetime($1))
74750TFif ($mother =~ /(.+)\s+\((.+)\)\s+(.+)/)
75050TFif ($father =~ /(.+?)\.\s\s/)
75750TFif ($text =~ /survived by (his|her) (father|mother)[\s,;]/i)
76150TFif (my $dt = _extract_date($1))
76450TFif ($2)
770100TFif ($text =~ /\bpassed away\b.*?\b(?:on\s+)?([A-Z]+ \d{1,2}, \d{4})/i)
77250TFif (my $dt = _extract_date($1))
778100TFif ($text =~ /,\s(\d{1,3}), of\s/)
77950TFif ($1 < 110)
785100TFif ($text =~ /\b(?:passed away|died)\b([a-z0-9\s,]+)\sat\s+(.+?)\./i)
78750TFif ($place =~ /(.+)\s+on\s+([A-Z]+ \d{1,2}, \d{4})/i) { }
100TFelsif ($place =~ /(.+)\son\s(.+)/) { }
79250TFif (my $dt = _extract_date($2))
80350TFif defined $family{$_}
807100TFif (ref $family{$key} eq "ARRAY")
809100TFif (@{$family{$key};} == 0)
815100TFunless scalar keys %family
82650TFunless ref $data eq "HASH"
831100TFif (ref $val eq 'ARRAY') { }
100TFelsif (ref $val eq 'HASH') { }
836100TFif (ref $item eq 'HASH' and exists $item->{'name'}) { }
851100TFif (exists $val->{'name'})
87050TFif $dt and not $@
87750TFunless ($geocoder)
87950TFif ($@)
8880TFunless scalar @locations
8920TFif (ref $result)