VectorSearch/lib_vector_search/include/bucket_finder.h

27 lines
504 B
C
Raw Normal View History

2024-03-21 12:23:26 +00:00
#pragma once
#include "finder.h"
#include "word_list.h"
#include <map>
class Bucket {
private:
2024-03-22 09:59:35 +00:00
std::map<char, WordRefList> directory_;
2024-03-21 12:23:26 +00:00
public:
void insert(const WordList &word_list, size_t first_index, size_t last_index);
WordRefList find_prefix(std::string_view search_term) const;
2024-03-21 12:23:26 +00:00
};
class BucketFinder : public Finder {
private:
std::vector<Bucket> buckets_;
public:
BucketFinder(const WordList &word_list);
WordRefList find_prefix(std::string_view search_term) const override;
2024-03-21 12:23:26 +00:00
};