namespace text¶
// namespaces namespace xf::data_analytics::text::enums namespace xf::data_analytics::text::internal
editDistance¶
#include "xf_data_analytics/text/editDistance.hpp"
template < int N, int M, int BITS > void editDistance ( hls::stream <ap_uint <BITS>>& len1_strm, hls::stream <ap_uint <64>>& query_strm, hls::stream <ap_uint <BITS>>& len2_strm, hls::stream <ap_uint <64>>& input_strm, hls::stream <ap_uint <BITS>>& max_ed_strm, hls::stream <bool>& i_e_strm, hls::stream <bool>& o_e_strm, hls::stream <bool>& o_match_strm )
Levenshtein distance implementation.
Parameters:
N | maximum length of query string. |
M | maximum length of input stream string, N must be less than M. |
BITS | data width of internal edit distance in bits. |
len1_strm | length of the query string in bytes. |
query_strm | the query string folded into mutiple 8B elements. |
len2_strm | length of each input string in bytes. |
input_strm | input strings to compute edit distance against the given query string, which is folded into multiple 8B elements. |
max_ed_strm | the maximum threshold of edit distance. |
i_e_strm | end flag of input_strm and max_ed_strm. |
o_e_strm | end flag of output matched stream. |
o_match_strm | only the calculated ED less than threshold in max_ed_strm will be TRUE. |
regexVM¶
#include "xf_data_analytics/text/regexVM.hpp"
template <int STACK_SIZE> void regexVM ( ap_uint <32>* bitSetBuff, ap_uint <64>* instrBuff, ap_uint <32>* msgBuff, unsigned int lenMsg, ap_uint <2>& match, ap_uint <16>* offsetBuff )
Implementation for regular expression VM (1 instruction per iteration).
Parameters:
STACK_SIZE | Size of internal stack. |
bitSetBuff | Bit set map for character class. |
instrBuff | Instruction buffer. |
msgBuff | Message buffer as input string. |
lenMsg | Length of input string. |
match | Flag to indicate whether the input string is matched or not, 0 for mismatch, 1 for match, 2 for stack overflow. |
offsetBuff | Offset address for each capturing group. |
regexVM_opt¶
#include "xf_data_analytics/text/regexVM.hpp"
template <int STACK_SIZE> void regexVM_opt ( ap_uint <32>* bitSetBuff, ap_uint <64>* instrBuff, ap_uint <32>* msgBuff, unsigned int lenMsg, ap_uint <2>& match, ap_uint <16>* offsetBuff )
Implementation for regular expression VM (2 instructions per iteration).
Parameters:
STACK_SIZE | Size of internal stack. |
bitSetBuff | Bit set map for cclass. |
instrBuff | Instruction buffer. |
msgBuff | Message buffer as input string. |
lenMsg | Length of input string. |
match | Flag to indicate whether the input string is matched or not, 0 for mismatch, 1 for match, 2 for stack overflow. |
offsetBuff | Offset address for each capturing group. |