[#58526092] cosine similarity macro + tests; piggback fix to NGramTokenize