calculating log probabilities of characters given a language, language given a document