fixed cosine similarity metric according to correct definition
corrected comment formula, added Ochiai coefficient note
fixed some formulae to better deal with short terms