Branch Coverage

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

line%coveragebranch
10450TFif (ref $text eq "SCALAR")
1320TFunless $list
14950TFunless $section
162100TFif ($entry =~ /^(\w+)\s+\(([^)]+)\)\s+(\w+)\s+of\s+(.+)$/) { }
100TFelsif ($entry =~ /^(.+?)\s+\(([^)]+)\)\s+of\s+(.+)$/) { }
100TFelsif ($entry =~ /^(.+?)\s+of\s+(.+)$/) { }
177100TFunless $name
178100TFif $name =~ /^father-in-law\sto\s/
179100TFif $name =~ /^devoted\s/i
18050TFif $name =~ /^loved\s/i
19050TFif defined $person{$_}
20450TFif ($phrase =~ /^((?:\w+\s*,\s*)+\w+),?\s*and\s+(\w+)\s+(\w+)$/)
21350TFif ($phrase =~ /^([\w\s]+?)\s+and\s+(\w+)\s+(\w+)$/)
22350TFif defined $_
228100TFif ($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) { }
246100TFif ($text =~ /\bdaughter,?\s([a-z]+)/i)
249100TFif ($text =~ /\bgranddaughter,?\s([a-z]+)/i)
25250TFif @children
253100TFif @grandchildren
260100TFif ($text =~ /\ssons,\s*(.*?);/s)
262100TFif ($sons_text =~ /, all of (.+)$/) { }
266100TFif ($son =~ /(\w+)\s+and\s+(\w+)/) { }
295100TFif ($text =~ /\sdaughters?,\s*Mrs\.\s+(.+?)\s+(\w+),\s+([^;]+)\sand/) { }
100TFelsif ($text =~ /one daughter,\s*(.+?),\s*(.+?);/) { }
30550TFif ($name =~ /(\w+)\s+(\w+)/) { }
320100TFif @children
322100TFunless ($family{"children"})
324100TF$1 eq 'son' ? :
32750TF$grandkids ? :
50TFif (my(@grandchildren) = $grandkids ? split(/\s*,\s*|\s+and\s+/, $grandkids, 0) : ()) { }
100TFelsif ($sex eq 'F' and $child =~ /(.+)\s+\((.+)\)/) { }
50TFelsif ($child ne 'Mrs') { }
340100TFif @children
343100TFunless ($family{"children"})
34450TFif ($text =~ /\ssons?[,\s]\s*(.+?)[;\.]/)
350100TFif ($text =~ /\sdaughters?[,\s]\s*(.+?)[;\.]/)
359100TFunless ($family{"grandchildren"})
360100TFif ($text =~ /grandchildren\s+([^\.;]+)/i)
36250TFif (scalar @grandchildren)
36350TFif defined $_
367100TFif ($family{'grandchildren'} and scalar @{$family{'grandchildren'};}) { }
37150TFif ($family{"grandchildren"}[0] =~ /brothers/)
3720TFunless (exists $family{'brothers'})
381100TFif (not defined $family{"grandchildren"} or $#{$family{"grandchildren"};} <= 0)
386100TFif ($grandchildren_str)
389100TFif (scalar @grandchildren) { }
100TFelsif ($text =~ /grandm\w+\s/) { }
399100TFif ($text =~ /predeceased by (his|her) sisters?\s*([^;\.]+);?/i) { }
407100TFif ($name eq "Mrs")
40850TFif ($text =~ / sister,\s*Mrs\.\s+([A-Z][a-zA-Z]+\s+[A-Z][a-zA-Z]+)/) { }
41450TFif ($name)
41550TF$text =~ /\bpredeceased by.*?$name/i ? :
422100TFunless (exists $family{'sisters'})
423100TFif ($text =~ /\stwo\ssisters,\s*(.*?)\sand\s(.*?)[;:]/s)
42650TFif ($sister =~ /Mrs\.\s(.+?),\s(.+)/) { }
43050TFif ($name =~ /(\w+)\s+(\w+)/) { }
45550TFif ($text =~ /predeceased by (his|her) brothers?\s*([^;\.]+);?/i) { }
46550TF$text =~ /\bpredeceased by.*?$1/i ? :
47050TFunless ($family{"brothers"} or $family{"sisters"} or $family{"siblings"})
471100TFif ($text =~ /sister of ([a-z]+) and ([a-z]+)/i)
478100TFunless (exists $family{'brothers'})
479100TFif ($text =~ /\sbrothers,\s*(.*?)[;\.]/s)
48150TFif ($brothers_text =~ /, all of (.+)$/) { }
485100TFif ($son =~ /(\w+)\s+and\s+(\w+)/) { }
518100TF$text =~ /as well as several nieces and nephews/i ? :
521100TFif ($text =~ /(son|daughter) of the late\s+(.+?)\s+and\s+(.+?)\./i) { }
100TFelsif ($text =~ /parents were (\w+) and (\w+)/i) { }
52950TFif ($mother =~ /(.+)\s+\((.+)\)\s+(.+)/)
544100TFif ($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) { }
5820TFif (exists $family{'spouse'} and ref $family{"spouse"} eq "HASH" and defined $family{"spouse"}[0]{"location"} and $family{"spouse"}[0]{"location"} eq "the late")
587100TFif ($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) { }
59950TFif ($family{"funeral"}{"date"} =~ /(.+?)\.\s{2,}/)
60150TFif ($family{"funeral"}{"date"} =~ /(.+?)\sat\s(.+)/)
619100TFif ($text =~ /father-in-law to\s+([A-Za-z\s]+)/) { }
100TFelsif ($text =~ /mother-in-law to\s+([A-Za-z\s]+)/i) { }
62550TFif (scalar($family{"children_in_law"} == 0))
631100TFif ($text =~ /niece of\s+([A-Za-z]+)/)
637100TFif ($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) { }
64450TFif (my $location = _extract_location($1))
64750TFif (my $dt = _extract_date($2))
65650TFif (my $dt = "DateTime::Format::Text"->parse_datetime($1))
66450TFif ($mother =~ /(.+)\s+\((.+)\)\s+(.+)/)
66750TFif ($father =~ /(.+?)\.\s\s/)
67450TFif ($text =~ /survived by (his|her) (father|mother)[\s,;]/i)
67850TFif (my $dt = _extract_date($1))
68150TFif ($2)
687100TFif ($text =~ /\bpassed away\b.*?\b(?:on\s+)?([A-Z]+ \d{1,2}, \d{4})/i)
693100TFif ($text =~ /,\s(\d{1,3}), of\s/)
69450TFif ($1 < 110)
700100TFif ($text =~ /\b(?:passed away|died)\b([a-z0-9\s,]+)\sat\s+(.+?)\./i)
70250TFif ($place =~ /(.+)\s+on\s+([A-Z]+ \d{1,2}, \d{4})/i) { }
100TFelsif ($place =~ /(.+)\son\s(.+)/) { }
70750TFif (my $dt = _extract_date($2))
71850TFif defined $family{$_}
722100TFif (ref $family{$key} eq "ARRAY")
724100TFif (@{$family{$key};} == 0)
73050TFunless scalar keys %family
74250TFif $dt and not $@
75250TFunless scalar @locations
7560TFif (ref $result)