String-Approx

 view release on metacpan or  search on metacpan

Approx.xs  view on Meta::CPAN

    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)));

Approx.xs  view on Meta::CPAN

	  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 1.981 second using v1.01-cache-2.11-cpan-5511b514fd6 )