MCPcopy Create free account
hub / github.com/comaps/comaps / GetNumDocs

Method GetNumDocs

libs/search/locality_scorer.cpp:45–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 ~IdfMapDelegate() override = default;
44
45 uint64_t GetNumDocs(UniString const & token, bool isPrefix) const override
46 {
47 if (isPrefix)
48 {
49 for (auto const & dfa : m_prefixToDf)
50 {
51 auto it = dfa.first.Begin();
52 DFAMove(it, token);
53 if (it.Accepts())
54 return dfa.second;
55 }
56 return 0;
57 }
58
59 for (auto const & dfa : m_tokensToDf)
60 {
61 auto it = dfa.first.Begin();
62 DFAMove(it, token);
63 if (it.Accepts())
64 return dfa.second;
65 }
66 return 0;
67 }
68
69private:
70 vector<pair<LevenshteinDFA, uint64_t>> const & m_tokensToDf;

Callers

nothing calls this directly

Calls 3

DFAMoveFunction · 0.85
BeginMethod · 0.45
AcceptsMethod · 0.45

Tested by

no test coverage detected