String-Approx
view release on metacpan or search on metacpan
OUTPUT:
RETVAL
void
slice(ap, text)
apse_t* ap
SV* text
PREINIT:
apse_size_t match_begin;
apse_size_t match_size;
PPCODE:
if (ap->use_minimal_distance) {
apse_slice(ap,
(unsigned char *)SvPV(text, PL_na),
(apse_size_t)sv_len(text),
&match_begin,
&match_size);
EXTEND(sp, 3);
PUSHs(sv_2mortal(newSViv(match_begin)));
PUSHs(sv_2mortal(newSViv(match_size)));
PUSHs(sv_2mortal(newSViv(ap->edit_distance)));
PUSHs(sv_2mortal(newSViv(match_size)));
}
void
slice_next(ap, text)
apse_t* ap
SV* text
PREINIT:
apse_size_t match_begin;
apse_size_t match_size;
PPCODE:
if (apse_slice_next(ap,
(unsigned char *)SvPV(text, PL_na),
sv_len(text),
&match_begin,
&match_size)) {
EXTEND(sp, 2);
PUSHs(sv_2mortal(newSViv(match_begin)));
PUSHs(sv_2mortal(newSViv(match_size)));
if (ap->use_minimal_distance) {
EXTEND(sp, 1);
( run in 0.683 second using v1.01-cache-2.11-cpan-5511b514fd6 )