liblevenshtein 4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
std::hash< liblevenshtein::Dawg > Struct Reference

Generates a hash code for the given DAWG. More...

#include <dawg.h>

Collaboration diagram for std::hash< liblevenshtein::Dawg >:

Public Member Functions

auto operator() (const liblevenshtein::Dawg &dawg) const -> size_t
 Generates a hash code for the given DAWG.
 

Detailed Description

Generates a hash code for the given DAWG.

Parameters
dawgDictionary whose hash code should be generated.
Returns
The generated hash code for the parameterized DAWG.

Definition at line 151 of file dawg.h.

Member Function Documentation

◆ operator()()

Generates a hash code for the given DAWG.

Parameters
dawgDAWG whose hash code is to be generated.
Returns
The hash code for the given DAWG.

Definition at line 81 of file dawg.cpp.

82 {
83
84 uint64_t hash_code = 0xDEADBEEF;
85
86 std::array<uint64_t, 1> key = {dawg._size};
88
89 key[0] = node_hash_code(*(dawg._root));
90 return MurmurHash64A(key.data(), 1, hash_code);
91}
static std::hash< liblevenshtein::DawgNode > node_hash_code
Definition dawg.cpp:79
void query(ll::Dawg *dawg, const std::string &query_term, std::size_t max_distance)
Definition main.cpp:25

References node_hash_code, and query().

Here is the call graph for this function:

The documentation for this struct was generated from the following files: