Fuzzy Match C++ API Reference¶
Overview¶
FuzzyMatch provides FuzzyMatch class which has interfaces to enable fuzzy match in batch mode. Maximum length of blacklist/query string: 64
Options¶
FuzyMatch constructor takes Options which configure the xclbin and device.
struct Options {
XString xclbinPath;
XString deviceNames;
};
startFuzzyMatch Interface¶
Initialize and set up FuzzyMatch software and Alveo cards.
- Return:
status: 0: successful; 1: fail.
int startFuzzyMatch()
fuzzyMatchLoadVec Interface¶
Load and preprocess the input table.
int fuzzyMatchLoadVec(std::vector<std::string>& vec_pattern,std::vector<int> vec_id=std::vector<int>())
- Parameters:
- vec_pattern : vector of pattern strings (e.g. black list strings).vec_id : vector of pattern id. if null, internally will assign sequential index of vec_pattern.
- Return:
status: 0: successful; 1: fail.
executefuzzyMatch Interface¶
Run fuzzymatch in batch mode. Match each input string in input_patterns vector against the pattern strings loaded using fuzzyMatchLoadVec interface.
std::vector<std::vector<std::pair<int,int>>> executefuzzyMatch(
std::vector<std::string> input_patterns,
int similarity_level);
- Parameters:
- input_patterns : vector of input strings. For each input string in input_patterns, run fuzzymatch against the pattern strings loaded using fuzzyMatchLoadVec interface.similarity_level : similarity threshold. value range [0-100]. 100 means exact same.
- Return:
2D vectors of pairs. Each row represents array of matched result pairs {id,score}. Maximum top 100 of pairs for each input string result.