You’re ranking pages for a search. Write about(times, page_length, average_length, enough): from 0 to 1, how much a page is about one word, given that the word appears times times. page_length is the page’s length in words and average_length the average over all pages. After about enough mentions on an average-length page, more mentions barely matter: the tenth “python” tells you little the ninth didn’t.
| times | page_length | |
|---|---|---|
| a short tip | 2 | 150 |
| a long guide | 6 | 1200 |
| a spam page | 400 | 500 |