some useful functions for analyzing text, especially categorizing texts by computing their similarities