You’re building search over a library of documents. Some words say what a document is about; others are just glue. Write importance(times_in_doc, docs_with_word, total_docs): how important one word is to one document. times_in_doc is how often this document uses the word, docs_with_word how many documents in the library use it at all, and total_docs how many documents there are.
| times_in_doc | docs_with_word | total_docs | |
|---|---|---|---|
| the | 30 | 100 | 100 |
| leaf | 6 | 20 | 100 |
| chlorophyll | 4 | 2 | 100 |