MCPcopy Create free account
hub / github.com/davisking/dlib / test_collisions

Function test_collisions

dlib/test/feature_hashing.cpp:82–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80// ----------------------------------------------------------------------------------------
81
82 void test_collisions()
83 {
84 // With one bucket, every n-gram lands in bucket 0.
85 DLIB_TEST(hash_word_ngrams(std::vector<std::string>{"a", "b", "c"}, 1, 2, 1) ==
86 sparse_type({{0, 5}}));
87 DLIB_TEST(hash_char_ngrams(std::vector<std::string>{"ab"}, 3, 5, 1) ==
88 sparse_type({{0, 3}}));
89 }
90
91// ----------------------------------------------------------------------------------------
92

Callers 1

perform_testMethod · 0.85

Calls 2

hash_word_ngramsFunction · 0.85
hash_char_ngramsFunction · 0.85

Tested by

no test coverage detected