DBIx-TextIndex

 view release on metacpan or  search on metacpan

TextIndex.xs  view on Meta::CPAN


BOOT:
{
    /* FIXME: error check */
    bitvec_boot();
}

void
term_docs_hashref(packed)
  SV *packed
PPCODE:
{
    HV *freqs;
    char *string;
    STRLEN len;
    int length;
    unsigned int value;
    int freq_is_next = 0;
    unsigned int doc = 0;
    char temp;

TextIndex.xs  view on Meta::CPAN

	    freq_is_next = 1;
	}
    }
    XPUSHs(sv_2mortal(newRV_noinc((SV *)freqs)));
}


void
term_docs_arrayref(packed)
  SV *packed
PPCODE:
{
    AV *results;
    char *string;
    STRLEN len;
    int length;
    unsigned int value;
    int freq_is_next = 0;
    unsigned int doc = 0;
    char temp;

TextIndex.xs  view on Meta::CPAN

	} else {
	    freq_is_next = 1;
	}
    }
    XPUSHs(sv_2mortal(newRV_noinc((SV *)results)));
}

void
term_doc_ids_arrayref(packed)
  SV *packed
PPCODE:
{
    AV *results;
    char *string;
    STRLEN len;
    int length;
    unsigned int value;
    int freq_is_next = 0;
    unsigned int doc = 0;
    char temp;

TextIndex.xs  view on Meta::CPAN

	    freq_is_next = 1;
	}
    }
    XPUSHs(sv_2mortal(newRV_noinc((SV *)results)));
}


void
term_docs_array(packed)
  SV *packed
PPCODE:
{
    char *string;
    STRLEN len;
    int length;
    unsigned int value;
    int freq_is_next = 0;
    unsigned int doc = 0;
    char temp;

    string = SvPV(packed, len);

TextIndex.xs  view on Meta::CPAN

	} else {
	    freq_is_next = 1;
	}
    }
}


void
term_docs_and_freqs(packed)
  SV *packed
PPCODE:
{
    AV *docs;
    AV *freqs;
    char *string;
    STRLEN len;
    int length;
    unsigned int value;
    int freq_is_next = 0;
    unsigned int doc = 0;
    char temp;

TextIndex.xs  view on Meta::CPAN

    }

    XPUSHs(newRV_inc((SV *)docs));
    XPUSHs(newRV_inc((SV *)freqs));
}


void
pack_vint(ints_arrayref)
  SV *ints_arrayref
PPCODE:
{
    char *packed;
    AV *term_freqs;
    I32 length = 0;
    unsigned int i, j, value;
    register unsigned long buff;
    if (! TEXTINDEX_DEREF_AV(ints_arrayref, term_freqs )) {
        TEXTINDEX_ERROR("args must be arrayref");
    }
    length = av_len(term_freqs);

TextIndex.xs  view on Meta::CPAN

        }
    }
    XPUSHs(sv_2mortal(newSVpv(packed, j)));
    Safefree(packed);
}


void
pack_vint_delta(ints_arrayref)
  SV *ints_arrayref
PPCODE:
{
    char *packed;
    AV *ints_array;
    I32 length = 0;
    unsigned int i, j, value, last_value, delta_value;
    register unsigned long buff;
    if (! TEXTINDEX_DEREF_AV(ints_arrayref, ints_array )) {
        TEXTINDEX_ERROR("args must be arrayref");
    }
    length = av_len(ints_array);

TextIndex.xs  view on Meta::CPAN

                break;
        }
    }
    XPUSHs(sv_2mortal(newSVpv(packed, j)));
    Safefree(packed);
}

void
pack_term_docs(term_docs_arrayref)
  SV *term_docs_arrayref
PPCODE:
{
    char *packed;
    I32 length = 0;
    unsigned int i, j, last_doc, value;
    register unsigned long buff;
    if (( !SvROK(term_docs_arrayref)
           || (SvTYPE(SvRV(term_docs_arrayref)) != SVt_PVAV) ))
    {
        TEXTINDEX_ERROR("args must be arrayref");
    }

TextIndex.xs  view on Meta::CPAN

        last_doc = doc;
    }
    XPUSHs(sv_2mortal(newSVpv((char *)packed, j)));
    Safefree(packed);
}

void
pack_term_docs_append_vint(packed, vint)
  SV *packed
  SV *vint
PPCODE:
{
    char *str_a, *str_b, *newpack;
    STRLEN len_a, len_b;
    I32 length_a = 0;
    I32 length_b = 0;
    int length = 0;
    int freq_is_next = 0;
    unsigned int value, val, i, j, freq;
    unsigned int doc = 0;
    unsigned int max_doc = 0;

TextIndex.xs  view on Meta::CPAN


void
pos_search(and_vec_ref, term_docs_arrayref, term_pos_arrayref, prox_SV, \
	   and_vec_min_SV, and_vec_max_SV)
  SV *and_vec_ref
  SV *term_docs_arrayref
  SV *term_pos_arrayref
  SV *prox_SV
  SV *and_vec_min_SV
  SV *and_vec_max_SV
PPCODE:
{
    I32 *length_td,
        *length_tp;
    unsigned int term_count,
                 prox        = SvIV(prox_SV),
	         and_vec_min = SvIV(and_vec_min_SV),
		 and_vec_max = SvIV(and_vec_max_SV),
		 doc,
		 doc_n,
		 *last_doc,

TextIndex.xs  view on Meta::CPAN

  SV *acc_lim_SV
  SV *res_min_SV
  SV *res_max_SV
  SV *f_t_SV
  SV *idf_SV
  SV *W_D_arrayref
  SV *avg_W_d_SV
  SV *w_qt_SV
  SV *k1_SV
  SV *b_SV
PPCODE:
{
    int          acc_size,
                 length;
    unsigned int acc_lim    =  SvIV(acc_lim_SV),
                 f_t        =  SvIV(f_t_SV),
                 res_min    =  SvIV(res_min_SV),
                 res_max    =  SvIV(res_max_SV),
                 doc,
                 last_doc,
                 f_dt,



( run in 0.606 second using v1.01-cache-2.11-cpan-71847e10f99 )