Branch Coverage

File:lib/CheckSpelling/UnknownWordSplitter.pm
Coverage:73.0%

line%coveragebranch
5550TFif $expression =~ /\?\{/u
6750TFdefined $2 ? :
7750TFif (open $fh, "<:utf8", $re)
86100TFif (/^#(?:\s(.+)|)/u)
87100TFif $hint eq "" and defined $1
90100TFunless $_ ne ""
9150TFif $_ eq "\$^"
93100TFunless s/^(.+)/(?:$1)/u
95100TFunless (test_re($quoted))
103100TFif (defined $hints{$_}) { }
13150TFtest_re($quoted) ? :
13350TFunless scalar @list
14550TFunless open my $file_fh, "<:utf8", $re
152100TFif /^#/u
15550TFunless /^./u
161100TFunless ($pairs == $true_pairs)
18250TFif $CheckSpelling::UnknownWordSplitter::shortest_word
183100TFif ($CheckSpelling::UnknownWordSplitter::longest_word) { }
100TFelsif (not_empty($CheckSpelling::UnknownWordSplitter::longest)) { }
192100TFif defined $_
193100TFunless $word_pattern
19450TFif (defined $CheckSpelling::UnknownWordSplitter::shortest and not_empty($CheckSpelling::UnknownWordSplitter::longest) and $CheckSpelling::UnknownWordSplitter::shortest > $CheckSpelling::UnknownWordSplitter::longest)
199100TFunless defined $CheckSpelling::UnknownWordSplitter::shortest
200100TFunless not_empty($CheckSpelling::UnknownWordSplitter::longest)
218100TFif (-s $homoglyph_list_path)
23050TFdefined $CheckSpelling::UnknownWordSplitter::longest_word ? :
241100TFunless $word =~ /$CheckSpelling::UnknownWordSplitter::word_match/u
243100TFunless not_empty($CheckSpelling::UnknownWordSplitter::longest)
244100TFif $l > $CheckSpelling::UnknownWordSplitter::longest
245100TFif $l < $CheckSpelling::UnknownWordSplitter::shortest
26150TFif (open my $aff_fh, "<", $aff)
2630TFunless /^SET\s+(\S+)/u
2640TFunless $1 =~ /utf-8/iu
286100TFif ($CheckSpelling::UnknownWordSplitter::hunspell_dictionary_path)
28850TFif (eval 'use Text::Hunspell; 1') { }
298100TFif (-e "$configuration/block-delimiters.list")
300100TFif (@block_delimiters)
31550TFif (-e "$configuration/patterns.txt") { }
323100TFif (-e "$configuration/forbidden.txt") { }
332100TFif (-e "$configuration/candidates.txt") { }
33450TF$in_patterns_re_list{$_} || !test_re($quoted) ? :
35250TFif ($CheckSpelling::UnknownWordSplitter::check_images)
3540TFif $CheckSpelling::UnknownWordSplitter::ocr_directory =~ /^(.*)$/u
364100TFunless -e $CheckSpelling::UnknownWordSplitter::base_dict
387100TFunless $token =~ /$pattern/u
393100TFunless $token =~ /$CheckSpelling::UnknownWordSplitter::word_match/u
394100TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$token})
399100TFif (@CheckSpelling::UnknownWordSplitter::hunspell_dictionaries)
40350TFdefined $hunspell_dictionary->{'encoding'} ? :
40450TFunless $hunspell_dictionary->{'engine'}->check($token_encoded)
41150TFif $found
414100TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$key})
41950TFunless ($CheckSpelling::UnknownWordSplitter::disable_word_collating)
421100TFunless length $key >= $shortest_threshold
42350TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$key})
4510TFif (-e $ocr_file and -e $ocr_source_sha and open my $source_sha, "<", $ocr_source_sha)
4560TFif ($last_sha =~ /(.*)/u)
4570TFif $1 eq $sha
4640TFunless defined $text_file
4670TFif ($text_file =~ /^(.*)$/u)
4700TFif ($file_size > 20) { }
498100TFunless $CheckSpelling::UnknownWordSplitter::ignore_next_line_pattern =~ /./u
51150TFif defined $ENV{'DEBUG'}
515100TFif (defined readlink $file and rindex("File::Spec"->abs2rel(abs_path($file)), "../", 0) == 0)
520100TFif ($use_magic_file) { }
50TFelsif ($file =~ /\.(?:png|jpe?g|gif)$/u) { }
52150TFif (open my $file_fh, "-|", "/usr/bin/file", "-b", "--mime", "-e", "cdf", "-e", "compress", "-e", "csv", "-e", "elf", "-e", "json", "-e", "tar", $file)
53550TFif ($CheckSpelling::UnknownWordSplitter::check_images and $file_kind =~ m[^image/]u)
538100TFif ($file_converted == 0 and $file_kind =~ /^(.*?); charset=binary/u)
54850TFif (defined $largest_file)
54950TFunless ($CheckSpelling::UnknownWordSplitter::check_file_names eq $file)
550100TFif ($file_size > $largest_file)
565100TFif ($unix_new_lines == 0 and $mac_new_lines == 0) { }
100TFelsif ($dos_new_lines >= $unix_new_lines and $dos_new_lines >= $mac_new_lines) { }
100TFelsif ($mac_new_lines > $unix_new_lines) { }
596100TFif ($. == 1)
59750TFunless ($disable_minified_file)
598100TFif ($file_size >= 512 and length $_ == $file_size)
60550TFif (/[\x{D800}-\x{DFFF}]/u)
610100TFif $. == 1
611100TFunless /./u
616100TFif ($CheckSpelling::UnknownWordSplitter::begin_block_re)
619100TFunless /\Q$next_end_marker\E/u
625100TFunless @captured
62750TFif ($captured[$capture])
635100TFif $parsed_block_markers
640100TFif $ignore_this_line
643100TFif (defined $CheckSpelling::UnknownWordSplitter::patterns_re)
649100TFif ($CheckSpelling::UnknownWordSplitter::forbidden_re)
657100TFif ($test_line =~ s/($forbidden_re_singleton)/"=" x length($1);/eu)
65850TFunless $test_line eq $_
66050TFunless $begin == $begin_test
66150TFunless $end == $end_test
66250TFunless $match eq $match_test
666100TFunless $forbidden_re_lines[$i]
671100TFif ($found_trigger_re) { }
675100TFif ($description ne '') { }
69150TFif (defined $CheckSpelling::UnknownWordSplitter::homoglyph_re)
69750TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$token})
714100TFif ($token =~ /^$CheckSpelling::UnknownWordSplitter::upper_pattern$CheckSpelling::UnknownWordSplitter::lower_pattern/u) { }
50TFelsif ($token =~ /^$CheckSpelling::UnknownWordSplitter::upper_pattern/u) { }
72150TF$token =~ /$CheckSpelling::UnknownWordSplitter::upper_pattern$/u ? :
72650TFunless $match =~ /./u
730100TFunless ($found_token)
73150TFif (not $raw_line =~ /$token.*$token/u and $raw_line =~ /($token)/u) { }
742100TFif ($line_flagged and $CheckSpelling::UnknownWordSplitter::candidates_re)
74550TFif ($_ ne $initial_line_state)
749100TFunless $candidate_re =~ /./u and $raw_line =~ /$candidate_re/u
75050TFif ($_ =~ s/($candidate_re)/"=" x length($1);/eu)
75650TFunless $candidates_re_lines[$i]
76250TFunless ($disable_minified_file)
767100TFif ($ratio > $ratio_threshold)
773100TFif ($next_end_marker)
77450TFif ($start_marker_line)
78450TFif ($@)
7850TFunless $@ eq "alarm\n"
794100TFif ($CheckSpelling::UnknownWordSplitter::unrecognized or @candidates_re_hits or @forbidden_re_hits)
796100TF@candidates_re_hits ? :
100TF@candidates_re_lines ? :
100TF@forbidden_re_hits ? :
100TF@forbidden_re_lines ? :
815100TFunless (%CheckSpelling::UnknownWordSplitter::dictionary)