liblevenshtein
4.0.0
A library for generating Finite State Transducers based on Levenshtein Automata.
Loading...
Searching...
No Matches
unsubsume.h
Go to the documentation of this file.
1
#ifndef LIBLEVENSHTEIN_TRANSDUCER_UNSUBSUME_H
2
#define LIBLEVENSHTEIN_TRANSDUCER_UNSUBSUME_H
3
4
#include <cstddef>
5
#include <functional>
6
7
#include "
liblevenshtein/transducer/position.h
"
8
#include "
liblevenshtein/transducer/state.h
"
9
10
namespace
liblevenshtein
{
11
14
using
SubsumesFn
= std::function<
bool
(
Position
*,
Position
*, std::size_t)>;
15
20
class
UnsubsumeFn
{
21
public
:
22
30
UnsubsumeFn
(
SubsumesFn
subsumes
);
31
40
void
operator()
(
State
*state, std::size_t query_length);
41
42
private
:
43
46
SubsumesFn
subsumes
;
47
};
48
49
}
// namespace liblevenshtein
50
51
52
#endif
// LIBLEVENSHTEIN_TRANSDUCER_UNSUBSUME_H
liblevenshtein::Position
Represents a location within the Levenshtein automaton.
Definition
position.h:11
liblevenshtein::State
Consists of a closure of Position nodes within the Levenshtein automaton.
Definition
state.h:23
liblevenshtein::UnsubsumeFn
Removes (unsubsumes) all Positions from a State that are subsumed by another Position within the same...
Definition
unsubsume.h:20
liblevenshtein::UnsubsumeFn::subsumes
SubsumesFn subsumes
Determines whether one Position subsumes another given the maximum edit distance to consider.
Definition
unsubsume.h:46
liblevenshtein::UnsubsumeFn::operator()
void operator()(State *state, std::size_t query_length)
Removes (unsubsumes) all Positions from a State that are subsumed by another Position within the same...
Definition
unsubsume.cpp:10
liblevenshtein::UnsubsumeFn::UnsubsumeFn
UnsubsumeFn(SubsumesFn subsumes)
Constructs a new UnsubsumeFn that uses a SubsumesFn to filter-out subsumed Positions from a State.
Definition
unsubsume.cpp:8
query
void query(ll::Dawg *dawg, const std::string &query_term, std::size_t max_distance)
Definition
main.cpp:25
liblevenshtein
Various utilities regarding Levenshtein transducers.
Definition
namespaces.dox:9
liblevenshtein::SubsumesFn
std::function< bool(Position *, Position *, std::size_t)> SubsumesFn
Determines whether one Position subsumes another given the maximum edit distance to consider.
Definition
unsubsume.h:14
position.h
state.h
src
liblevenshtein
transducer
unsubsume.h
Generated by
1.10.0