my own implementation of tf-idf (text freqency -- inverse document frequency) for document comparison