Branch Coverage

blib/lib/Algorithm/VSM.pm
Criterion Covered Total %
branch 92 328 28.0


line true false branch
40 0 2 if _check_for_illegal_params(@params) == 0
43 0 2 exists $args{'break_camelcased_and_underscored'} ? :
0 2 exists $args{'use_idf_filter'} ? :
0 2 exists $args{'relevancy_threshold'} ? :
94 0 2 unless $$self{'_corpus_directory'}
96 0 2 if $$self{'_debug'}
99 0 2 if $$self{'_stop_words_file'}
100 0 2 if ($$self{'_debug'})
105 0 2 if ($$self{'_save_model_on_disk'})
109 0 0 unless tie %{$$self{'_vocab_hist_on_disk'};}, 'SDBM_File', $$self{'_corpus_vocab_db'}, 66, 416
119 0 2 if $$self{'_debug'}
133 0 0 unless keys %{$$self{'_vocab_hist'};}
144 0 0 unless keys %{$$self{'_vocab_hist'};}
152 0 0 unless keys %{$$self{'_vocab_hist'};}
153 0 0 unless open OUT, "> $file"
165 0 0 unless keys %{$$self{'_vocab_idf_hist'};}
166 0 0 unless $$self{'_idf_filter_option'}
197 0 2 if ($$self{'_save_model_on_disk'})
198 0 0 unless $$self{'_doc_vectors_db'} and $$self{'_normalized_doc_vecs_db'}
205 0 0 if ($@)
211 0 0 if ($@)
220 0 0 unless keys %{$$self{'_corpus_doc_vectors'};}
234 0 0 unless keys %{$$self{'_normalized_doc_vecs'};}
235 0 0 unless ($$self{'_idf_filter_option'})
258 0 0 unless contained_in($doc1, @all_files)
259 0 0 unless contained_in($doc2, @all_files)
280 0 0 unless contained_in($doc1, @all_files)
281 0 0 unless contained_in($doc2, @all_files)
305 1 0 if ($$self{'_break_camelcased_and_underscored'}) { }
309 0 0 $1 ? :
310 7 1 $1 ? :
0 1 $$self{'_case_sensitive'} ? :
316 0 1 if $$self{'_debug'}
317 1 0 if ($$self{'_idf_filter_option'}) { }
320 0 1 unless scalar keys %{$$self{'_vocab_hist'};} and scalar keys %{$$self{'_normalized_doc_vecs'};}
324 0 0 unless scalar keys %{$$self{'_vocab_hist'};} and scalar keys %{$$self{'_corpus_doc_vectors'};}
330 0 7 if ($$self{'_case_sensitive'}) { }
331 0 0 if exists $$self{'_vocab_hist'}{$_}
333 2 5 if exists $$self{'_vocab_hist'}{"\L$_\E"}
338 0 1 unless $query_word_count_total
341 1 0 if ($$self{'_idf_filter_option'}) { }
342 0 1 if $$self{'_debug'}
349 0 0 if $$self{'_debug'}
356 0 1 if ($$self{'_debug'})
369 0 0 unless -s "$$self{'_corpus_vocab_db'}.pag" and -s $$self{'_doc_vectors_db'}
373 0 0 unless tie %{$$self{'_vocab_hist_on_disk'};}, 'SDBM_File', $$self{'_corpus_vocab_db'}, 0, 416
376 0 0 if ($$self{'_debug'})
386 0 0 if $$self{'_debug'}
394 0 0 unless -s "$$self{'_corpus_vocab_db'}.pag" and -s $$self{'_normalized_doc_vecs_db'}
398 0 0 unless tie %{$$self{'_vocab_hist_on_disk'};}, 'SDBM_File', $$self{'_corpus_vocab_db'}, 0, 416
401 0 0 if ($$self{'_debug'})
411 0 0 if $$self{'_debug'}
426 0 0 if $iter > $$self{'_max_number_retrievals'}
437 0 4 unless chdir $dir
439 0 32 if (-d $_ and not -l $_) { }
32 0 elsif (-r _ and -T _ and -M _ > 1e-05 and not -l $_ and $self->ok_to_filetype($_)) { }
441 0 0 unless chdir $dir
448 0 32 if $$self{'_scan_dir_for_rels'}
449 16 16 unless $$self{'_corpus_vocab_done'}
450 16 16 if $$self{'_corpus_vocab_done'}
463 124 710 if /^[ ]*\r?\n?$/
466 710 0 if ($$self{'_break_camelcased_and_underscored'}) { }
470 0 0 $1 ? :
471 1718 994 $1 ? :
0 710 $$self{'_case_sensitive'} ? :
476 284 426 unless @clean_words
477 426 0 if $$self{'_want_stemming'}
481 0 426 $$self{'_case_sensitive'} ? :
482 0 426 if ($$self{'_case_sensitive'}) { }
498 0 32 unless @{$$self{'_file_types'};} > 0
499 32 0 if contained_in($suffix, @{$$self{'_file_types'};})
507 1 0 if ($$self{'_idf_filter_option'}) { }
508 0 1 if (not $$self{'_normalized_doc_vecs'} and -s $$self{'_normalized_doc_vecs_db'})
523 0 0 if (not $$self{'_corpus_doc_vectors'} and -s $$self{'_doc_vectors_db'})
537 0 1 if $$self{'_debug'}
538 0 1 if $$self{'_debug'}
542 0 1 if $$self{'_debug'}
555 0 1 if $$self{'_debug'}
559 1 0 $$self{'_idf_filter_option'} ? :
565 0 8 if $$self{'_debug'}
578 1 0 if ($$self{'_break_camelcased_and_underscored'}) { }
581 7 1 $1 ? :
587 0 1 if $$self{'_debug'}
589 0 1 unless scalar keys %{$$self{'_vocab_hist'};}
591 0 1 unless scalar keys %{$$self{'_doc_vecs_trunc_lsa'};}
596 2 5 if exists $$self{'_vocab_hist'}{"\L$_\E"}
601 0 1 unless $query_word_count_total
607 0 1 if $$self{'_debug'}
610 0 1 if $$self{'_debug'}
616 0 8 if $$self{'_debug'}
621 0 1 if ($$self{'_debug'})
640 0 16 unless (open IN, $file)
641 0 0 if $$self{'_debug'}
646 124 710 if /^[ ]*\r?\n?$/
650 284 426 unless @clean_words
651 426 0 if $$self{'_want_stemming'}
657 0 426 $$self{'_case_sensitive'} ? :
660 0 16 unless $$self{'_vocab_size'} == scalar keys %document_vector
666 16 0 if ($$self{'_idf_filter_option'})
678 0 16 if (not $1 eq '') { }
691 0 0 unless open IN, "$$self{'_working_directory'}/$$self{'_stop_words_file'}"
694 0 0 if /^#/
695 0 0 if /^[ ]*\r?\n?$/
697 0 0 if exists $$self{'_vocab_hist'}{$_}
707 16 0 $$self{'_idf_filter_option'} ? :
710 16 0 $$self{'_idf_filter_option'} ? :
728 7 9 if $product1 < $product2
729 0 9 if $product1 == $product2
730 9 0 if $product1 > $product2
736 8 0 $$self{'_idf_filter_option'} ? :
770 0 0 unless $$self{'_query_file'}
772 0 0 unless open IN, $$self{'_query_file'}
774 0 0 unless $$self{'_relevancy_file'}
778 0 0 if /^#/
779 0 0 if /^[ ]*\r?\n?$/
781 0 0 unless /^[ ]*q[0-9]+:/
785 0 0 unless $query
788 0 0 if ($$self{'_debug'})
797 0 0 unless open OUT, ">$$self{'_relevancy_file'}"
820 0 0 unless open IN, $$self{'_relevancy_file'}
823 0 0 if /^#/
824 0 0 if /^[ ]*\r?\n?$/
826 0 0 unless /^[ ]*q[0-9]+[ ]*=>/
830 0 0 unless $relevancy_docs_string
835 0 0 if ($$self{'_debug'})
846 0 0 unless scalar keys %{$$self{'_relevancy_estimates'};}
872 0 0 if $$self{'_debug'}
875 0 0 if $$self{'_debug'}
877 0 0 if @matches
879 0 0 if $$self{'_debug'}
881 0 0 if $count >= $$self{'_relevancy_threshold'}
892 0 0 unless scalar keys %{$$self{'_relevancy_estimates'};}
893 0 0 unless (scalar keys %{$$self{'_queries_for_relevancy'};})
894 0 0 unless open IN, $$self{'_query_file'}
897 0 0 if /^#/
898 0 0 if /^[ ]*\r?\n?$/
900 0 0 unless /^[ ]*q[0-9]+:/
904 0 0 unless $query
907 0 0 if ($$self{'_debug'})
915 0 0 if $$self{'_debug'}
918 0 0 unless defined $retrieval_type
923 0 0 if ($retrieval_type eq 'vsm') { }
0 0 elsif ($retrieval_type eq 'lsa') { }
929 0 0 if ($@)
941 0 0 if ($$self{'_debug'})
967 0 0 if ($$self{'_debug'})
974 0 0 unless @relevant_set
977 0 0 unless @relevant_set
978 0 0 if $$self{'_debug'}
984 0 0 if $$self{'_debug'}
998 0 0 @retrieved_at_rank ? :
1005 0 0 if $$self{'_debug'}
1007 0 0 if $$self{'_debug'}
1020 0 0 if $$self{'_debug'}
1028 0 0 unless scalar keys %{$$self{'_map_vals_for_queries'};}
1048 0 0 unless scalar keys %{$$self{'_precision_for_queries'};}
1068 0 0 unless scalar keys %{$$self{'_map_vals_for_queries'};}
1106 17 85 if ($param eq $legal)
1111 0 17 if $found_match_flag == 0
1121 32 32 if $ele eq $_
1138 0 40 unless @$vec1 == @$vec2
1168 0 3310 if $debug
1181 0 3310 if $debug
1202 0 0 @common_elements ? :