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

version» Context lines:

pike.git/lib/modules/Search.pmod/module.pmod:70:   {    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, + array(mapping) splitter(array(string) text, array(int) context,    function(string:string) post_normalization,    function(mapping:int) ranking)   { -  if(sizeof(text)!=sizeof(context) || -  sizeof(text)!=sizeof(offset) ) return 0; +  if(sizeof(text)!=sizeof(context)) +  return 0;       array(mapping) result=({});    for(int i=0; i<sizeof(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, +  // "offset":offset[i]+oldinc,    // This might be destroyed by pre_normalization    ]);    n_word->rank=ranking(n_word);    result+=({ n_word });    }    }       return result;   }