String Matching API

Modules

 Pattern Options
 Pattern options control how the string search automaton is built.
 

Data Structures

struct  ap_error_definition
 Structure to store approximate string error profile. More...
 

Typedefs

typedef struct ap_string_encode_info_objref * ap_encode_info_t
 Opaque object for storing the encode information for approximate string matching. More...
 

Functions

COMPILE_API int AP_CompileStringSearchAutomaton (ap_automaton_t *automaton, ap_encode_info_t *encode_info, struct ap_error_definition *error_defs, const char **patterns, unsigned pattern_count, unsigned pattern_options)
 Compile automaton to perform Approximate String Match for patterns with defined error profile. More...
 
COMPILE_API int AP_CompileStringSearchAutomatonEx (ap_automaton_t *automaton, ap_encode_info_t *encode_info, struct ap_error_definition *allowed_errors, const char **patterns, unsigned pattern_count, unsigned pattern_options, ap_cbinfo_t *callback, unsigned options, int devfamily)
 Compile automaton to perform Approximate String Match for patterns with defined error profile. More...
 
COMPILE_API int AP_GetStringMatchMacroDef (ap_anml_t anml, ap_macro_def_t *macro_def, struct ap_error_definition *error_def, unsigned window_index, unsigned report, unsigned input, unsigned output, unsigned pattern_options)
 Get an approximate string search macro definition with specified error definitions and port/report properties. More...
 
COMPILE_API int AP_GetStringMatchMacroDefEx (ap_anml_t anml, ap_macro_def_t *macro_def, struct ap_error_definition *error_def, unsigned window_index, unsigned report, unsigned input, unsigned output, unsigned pattern_options, ap_cbinfo_t *callback, unsigned options)
 Get an approximate string search macro definition with specified error definitions and port/report properties. More...
 
COMPILE_API int AP_ConfigureStringMacroRef (ap_anml_t anml, ap_anml_namespace_t anml_ns, ap_anml_element_ref_t macro_ref, ap_macro_def_t macro_def, ap_encode_info_t *encode_info, const char *pattern)
 Configure a string match macro reference. More...
 
AP_API int AP_SaveEncodeInfo (const ap_encode_info_t encode_info, file_descriptor_t fd)
 Save string encoding information to a file. More...
 
AP_API int AP_RestoreEncodeInfo (ap_encode_info_t *encode_info, file_descriptor_t fd)
 Restore string encoding information from a file. More...
 
AP_API int AP_DestroyEncodeInfo (ap_encode_info_t encode_info)
 Destroy encode information object. More...
 
AP_API int AP_EncodeMacroPatternInput (ap_encode_info_t encode_info, const char *input_string, unsigned char *encoded_string, unsigned string_length, unsigned input_escaped)
 Get a encoded string given the enode_info of a macro. More...
 

Detailed Description

The programming interface for compiling and executing approximate string matching.

#include <micron/ap/ap_error.h>
#include <micron/ap/ap_exec.h>
#include <micron/ap/ap_load.h>
#include <micron/ap/ap_element_map.h>
#include <micron/ap/ap_string_encode_info.h>

This API allows searching for string string patterns (text or non-text) within a defined error tolerances. The error tolerances are specified in the form of numbers of symbol mismatches/substitutions, insertions, and deletions. Error tolerances can be defined towards specified window (sub-string) of string patterns. This API also provide scoring feature that can count the number of errors (Levenshtein distance) between the string pattern and the matched input data string.