add fuzzy search
This commit is contained in:
parent
f31eec1a41
commit
9da56a412a
|
@ -63,7 +63,7 @@ typedef struct {
|
||||||
|
|
||||||
FstRegex *regexCreate(const char *str);
|
FstRegex *regexCreate(const char *str);
|
||||||
|
|
||||||
void regexSetup(FstRegex *regex, uint32_t size, const char *str);
|
// void regexSetup(FstRegex *regex, uint32_t size, const char *str);
|
||||||
|
|
||||||
// uint32_t regexStart()
|
// uint32_t regexStart()
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "indexFstRegex.h"
|
#include "indexFstRegex.h"
|
||||||
|
#include "indexFstDfa.h"
|
||||||
#include "indexFstSparse.h"
|
#include "indexFstSparse.h"
|
||||||
|
|
||||||
FstRegex *regexCreate(const char *str) {
|
FstRegex *regexCreate(const char *str) {
|
||||||
|
@ -26,9 +27,11 @@ FstRegex *regexCreate(const char *str) {
|
||||||
memcpy(orig, str, sz);
|
memcpy(orig, str, sz);
|
||||||
|
|
||||||
regex->orig = orig;
|
regex->orig = orig;
|
||||||
}
|
|
||||||
|
|
||||||
void regexSetup(FstRegex *regex, uint32_t size, const char *str) {
|
// construct insts based on str
|
||||||
// return
|
SArray *insts = NULL;
|
||||||
// return;
|
|
||||||
|
FstDfaBuilder *builder = dfaBuilderCreate(insts);
|
||||||
|
regex->dfa = dfaBuilderBuild(builder);
|
||||||
|
return regex;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue