mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-10 08:12:21 +03:00
Adding support for compiling approximate matching patterns
Adds new "edit_distance" extparam
This commit is contained in:
committed by
Matthew Barr
parent
60fc975c81
commit
2de6706df2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2016, Intel Corporation
|
||||
* Copyright (c) 2015-2017, Intel Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "nfagraph/ng.h"
|
||||
#include "nfagraph/ng_expr_info.h"
|
||||
#include "nfagraph/ng_extparam.h"
|
||||
#include "nfagraph/ng_fuzzy.h"
|
||||
#include "parser/parse_error.h"
|
||||
#include "parser/Parser.h"
|
||||
#include "parser/prefilter.h"
|
||||
@@ -379,6 +380,12 @@ hs_error_t hs_expression_info_int(const char *expression, unsigned int flags,
|
||||
throw ParseError("Internal error.");
|
||||
}
|
||||
|
||||
// validate graph's suitability for fuzzing
|
||||
validate_fuzzy_compile(*g, g->edit_distance, g->utf8, cc.grey);
|
||||
|
||||
// fuzz graph - this must happen before any transformations are made
|
||||
make_fuzzy(*g, g->edit_distance, cc.grey);
|
||||
|
||||
handleExtendedParams(rm, *g, cc);
|
||||
fillExpressionInfo(rm, *g, &local_info);
|
||||
}
|
||||
|
Reference in New Issue
Block a user