Algorithm for the course Text Mining