This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
VectorSearch/lib_vector_search/include/bucket_finder.h

27 lines
507 B
C++

#pragma once
#include "finder.h"
#include "word_list.h"
#include <map>
class Bucket {
private:
std::map<const char, WordRefList> groups_;
public:
void insert(const WordList &word_list, size_t first_index, size_t last_index);
WordRefList find_prefix(std::string_view search_term) const;
};
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;
};