test package
Submodules
test.test_fuzzy_context_searcher module
- class test.test_fuzzy_context_searcher.TestFuzzyContextSearcher(methodName='runTest')
Bases:
unittest.case.TestCase- setUp() None
Hook method for setting up the test fixture before exercising it.
- test_fuzzy_context_searcher()
- test_fuzzy_context_searcher_can_add_context()
- test_fuzzy_context_searcher_can_search_context()
- test_fuzzy_context_searcher_can_set_context_size()
- test_fuzzy_context_searcher_finds_match_with_context()
test.test_fuzzy_match module
- class test.test_fuzzy_match.TestFuzzyMatch(methodName='runTest')
Bases:
unittest.case.TestCase- test_adjust_boundaries_finds_word_boundary()
- test_adjust_boundaries_removes_surrounding_whitespace()
- test_adjust_end()
- test_adjust_end_does_not_shift_when_end_middle_of_next_word()
- test_adjust_end_shifts_back_one_when_ending_with_whitespace()
- test_adjust_end_shifts_back_one_when_phrase_ends_with_whitespace()
- test_adjust_end_shifts_back_two_when_ending_with_whitespace_and_char()
- test_adjust_end_shifts_to_end_of_next_word()
- test_adjust_start()
- test_adjust_start_does_not_shift_to_third_previous_character()
- test_adjust_start_returns_when_in_middle_of_word()
- test_adjust_start_shifts_to_next_character()
- test_adjust_start_shifts_to_previous_character()
- test_adjust_start_shifts_to_second_previous_characters()
- test_map_string_maps_mixed_string()
- test_map_string_maps_space_string()
- test_map_string_maps_word_string()
- class test.test_fuzzy_match.TestMatchAnnotation(methodName='runTest')
Bases:
unittest.case.TestCase- setUp() None
Hook method for setting up the test fixture before exercising it.
- test_match_as_web_anno_has_label()
- test_match_as_web_anno_has_multiple_bodies()
- test_match_as_web_anno_skips_correction_with_exact_match()
- test_match_in_context_as_web_anno_has_multiple_selectors()
- test_match_in_context_as_web_anno_has_text_quote_selector()
test.test_fuzzy_phrase module
- class test.test_fuzzy_phrase.Test(methodName='runTest')
Bases:
unittest.case.TestCase- test_skipgrams_have_correct_length()
- test_text2skipgrams_accepts_positive_ngram_size()
- test_text2skipgrams_rejects_negative_ngram_size()
- test_text2skipgrams_rejects_negative_skip_size()
- class test.test_fuzzy_phrase.TestFuzzyPhrase(methodName='runTest')
Bases:
unittest.case.TestCase- test_fuzzy_phrase_accepts_phrase_as_dict()
- test_fuzzy_phrase_accepts_phrase_as_string()
- test_fuzzy_phrase_accepts_phrase_with_valid_list_of_strings_label()
- test_fuzzy_phrase_accepts_phrase_with_valid_string_label()
- test_fuzzy_phrase_can_set_max_end()
- test_fuzzy_phrase_can_set_max_offset()
- test_fuzzy_phrase_cannot_set_negative_max_offset()
- test_fuzzy_phrase_rejects_phrase_with_invalid_label()
test.test_fuzzy_phrase_model module
- class test.test_fuzzy_phrase_model.Test(methodName='runTest')
Bases:
unittest.case.TestCase- test_can_add_custom_key_value_pairs_to_phrase()
- test_can_add_distractors()
- test_can_add_label_as_list_to_phrase()
- test_can_add_label_to_phrase()
- test_can_add_variant_phrase()
- test_can_configure_ngram_size()
- test_can_get_json_representation()
- test_making_empty_phrase_model()
- test_making_phrase_model_with_list_of_keyword_strings()
- test_making_phrase_model_with_list_of_phrase_dictionaries()
- test_phrase_model_can_add_phrase()
- test_phrase_model_can_remove_phrase()
- test_phrase_model_indexes_phrase_words()
test.test_fuzzy_phrase_searcher module
- class test.test_fuzzy_phrase_searcher.TestCandidate(methodName='runTest')
Bases:
unittest.case.TestCase- test_candidate_detects_no_match()
- test_candidate_detects_no_match_with_no_skip_match()
- test_candidate_has_skipgram_overlap()
- class test.test_fuzzy_phrase_searcher.TestFuzzyPhraseSearcher(methodName='runTest')
Bases:
unittest.case.TestCase- test_can_add_phrases_as_phrase_objects()
- test_can_add_phrases_as_strings()
- test_can_filter_skipgram_threshold()
- test_can_generate_skip_matches()
- test_can_get_candidates()
- test_can_make_default_phrase_searcher()
- test_finds_multiple_candidates()
- test_searcher_allows_length_variance()
- test_searcher_allows_length_variance_2()
- test_searcher_can_match_distractors()
- test_searcher_can_match_variants()
- test_searcher_can_register_distractors()
- test_searcher_can_register_variants()
- test_searcher_can_toggle_distractors()
- test_searcher_can_toggle_variants()
- test_searcher_finds_correct_start()
- test_searcher_finds_near_match()
- test_searcher_finds_repeat_phrases_as_multiple_matches()
- test_searcher_handles_ignorecase()
- test_searcher_is_case_sensitive()
- test_searcher_uses_word_boundaries()
- class test.test_fuzzy_phrase_searcher.TestFuzzySearchExactMatch(methodName='runTest')
Bases:
unittest.case.TestCase- setUp() None
Hook method for setting up the test fixture before exercising it.
- test_fuzzy_search_can_search_exact_match()
- test_fuzzy_search_can_search_exact_match_with_special_characters()
- test_fuzzy_search_can_search_exact_match_with_word_boundaries()
- test_fuzzy_search_can_search_exact_match_without_word_boundaries()
- test_text_split()
- class test.test_fuzzy_phrase_searcher.TestSearcherRealData(methodName='runTest')
Bases:
unittest.case.TestCase- setUp() None
Hook method for setting up the test fixture before exercising it.
- test_fuzzy_search_text1_finds_attendants()
- test_fuzzy_search_text1_finds_date()
- test_fuzzy_search_text1_finds_four_matches()
- test_fuzzy_search_text1_finds_friday()
- test_fuzzy_search_text1_finds_president()
- test_fuzzy_search_text2_finds_attendants()
- test_fuzzy_search_text2_finds_date()
- test_fuzzy_search_text2_finds_four_matches()
- test_fuzzy_search_text2_finds_friday()
- test_fuzzy_search_text2_finds_president()
- class test.test_fuzzy_phrase_searcher.TestSearcherRealData2(methodName='runTest')
Bases:
unittest.case.TestCase- setUp() None
Hook method for setting up the test fixture before exercising it.
- test_searcher_allows_length_variance_2()
- test_searcher_allows_length_variance_3()
- test_searcher_find_no_overlapping_variants()
- test_searcher_finds_DONtfangen()
- test_searcher_finds_long_opening()
test.test_fuzzy_string module
- class test.test_fuzzy_string.Test(methodName='runTest')
Bases:
unittest.case.TestCase- test_make_ngrams_accepts_positive_integer()
- test_make_ngrams_handles_size_one_correctly()
- test_make_ngrams_handles_size_two_correctly()
- test_make_ngrams_rejects_integer_larger_than_text_length()
- test_make_ngrams_rejects_negative_size()
- test_make_ngrams_rejects_non_integer_size()
- test_make_ngrams_rejects_non_string_text()
- test_score_char_overlap_with_self_is_len_of_self()
- test_score_char_overlap_with_smaller_word_is_smaller_than_len_of_self()
- test_score_levenshtein_similarity_with_self_is_len_of_self()
- test_score_ngram_overlap_is_num_ngrams_for_self_comparison()
- test_score_ngram_overlap_is_zero_for_comparison_with_empty()
test.test_fuzzy_template module
- class test.test_fuzzy_template.TestFuzzyTemplate(methodName='runTest')
Bases:
unittest.case.TestCase- setUp() None
Hook method for setting up the test fixture before exercising it.
- test_template_can_get_phrase_by_label()
- test_template_can_ignore_element_with_unknown_label()
- test_template_can_register_group_elements()
- test_template_can_return_required_elements()
- test_template_cannot_register_element_with_unknown_label()
- test_template_generation()
- test_template_get_phrase_by_label_returns_correct_phrase()
- test_template_get_phrase_by_label_returns_phrase_object()
- test_template_register_simple_element()
- test_template_register_simple_element_as_multi_if_no_cardinality()
- test_template_register_simple_element_with_list_labels()
- test_template_returns_all_required_element_labels()
- test_template_returns_all_required_elements()
- class test.test_fuzzy_template.TestFuzzyTemplateElement(methodName='runTest')
Bases:
unittest.case.TestCase- test_template_accepts_label_and_cardinality()
- test_template_accepts_label_only()
- test_template_rejects_invalid_cardinality_value()
test.test_fuzzy_template_searcher module
- class test.test_fuzzy_template_searcher.TestFuzzyTemplateSearcher(methodName='runTest')
Bases:
unittest.case.TestCase- setUp() None
Hook method for setting up the test fixture before exercising it.
- test_add_template_sets_phrase_model()
- test_can_add_template_at_init()
- test_can_add_template_later()
- test_can_make_searcher()
- test_can_search_text()
- test_configure_ngram_size()
- test_search_text_returns_template_matches()
- test_throws_error_for_mismatch_ngram_size()
- class test.test_fuzzy_template_searcher.TestFuzzyTemplateSearcherWithRealData(methodName='runTest')
Bases:
unittest.case.TestCase- prep_test(test_name)
- setUp() None
Hook method for setting up the test fixture before exercising it.
- test_search_text_finds_template_with_auction_test_1()
- test_search_text_finds_template_with_auction_test_2()
- test_search_text_finds_template_with_auction_test_3()
- test_search_text_finds_template_with_auction_test_4()