diff options
author | Karl Williamson <khw@cpan.org> | 2016-02-09 10:40:38 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-02-09 23:30:53 -0700 |
commit | c6871b765d934773fb82823602c1e03e073c38ac (patch) | |
tree | ff9962440fdd86916e5ebe1953801dbfe6f372cf /embed.fnc | |
parent | 54e70d91fbed63597a6d5ea1113abcb56b8a22c0 (diff) | |
download | perl-c6871b765d934773fb82823602c1e03e073c38ac.tar.gz |
regcomp.c: Add code to compute edit distance (Damerau–Levenshtein)
This will be used in a future commit.
This code is taken from CPAN Text::Levenshtein::Damerau::XS with the
author's knowledge. There have been white-space changes to make it
conform better to perl's core coding standards, and declaration changes
to make it more portable, such as using UV instead of 'unsigned int',
and PERL_STATIC_INLINE instead of a less portable form, but the logic is
unchanged. One variable was changed to signed from unsigned to avoid a
warning message from some compilers.
The author and I will decide later about keeping the cpan module and
this code in sync. It changes very rarely.
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -2244,6 +2244,11 @@ Es |I32 |make_trie |NN RExC_state_t *pRExC_state \ Es |regnode *|construct_ahocorasick_from_trie|NN RExC_state_t *pRExC_state \ |NN regnode *source|U32 depth EnPs |const char *|cntrl_to_mnemonic|const U8 c +EnPs |int |edit_distance |NN const UV *src \ + |NN const UV *tgt \ + |const STRLEN x \ + |const STRLEN y \ + |const SSize_t maxDistance # ifdef DEBUGGING Es |void |regdump_intflags|NULLOK const char *lead| const U32 flags Es |void |regdump_extflags|NULLOK const char *lead| const U32 flags |