Branch: Tag:

2000-10-27

2000-10-27 15:30:44 by Martin Nilsson <mani@lysator.liu.se>

A simple query independent page ranking algorithm

Rev: lib/modules/Search.pmod/module.pmod:1.5

121:    }      } +  +  + // --- Page Ranking Algorithms ------------ +  + float entropy(array(string) page_words) { +  mapping(string:int) words=([]); +  foreach(page_words, string word) +  words[word]=1; +  return (float)sizeof(words)/(float)sizeof(page_words); + } +  + // A normal page has an entropy value around 0.5, so the result x should probably be + // remapped to abs(x-0.5) or even 1-abs(x-0.5) +