pike.git / lib / modules / Search.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Search.pmod/module.pmod:73:   Filter get_filter(string mime_type) {    if(!filters[mime_type]) return 0;    return filters[mime_type]->Filter();   }      array(string) get_filter_mime_types() {    return indices(filters);   }      array(mapping) splitter(array(string) text, array(int) context, array(int) offset, -  function(string:string) pre_normalization, +     function(string:string) post_normalization,    function(mapping:int) ranking) {    if(sizeof(text)!=sizeof(context) ||    sizeof(text)!=sizeof(offset) ) return 0;       array(mapping) result=({});    for(int i=0; i<sizeof(text); i++) { -  array words=pre_normalization(text[i])/" "; +  array words=text[i]/" ";    int inc=0, oldinc;    foreach(words, string word) {    oldinc=inc;    inc+=sizeof(word)+1;    word=post_normalization(word);    if(!sizeof(word)) continue;    mapping n_word=([ "word":word,    "type":context[i],    "offset":offset[i]+oldinc, // This might be destroyed by pre_normalization    ]);