public static void LogBOW(BagOfWords bow) { string filepath = CreateFilePath(BOW_FILE); using (StreamWriter writer = new StreamWriter(filepath)) { foreach (var kvp in bow.OrderByDescending(kvp => kvp.Value)) { writer.WriteLine(string.Format("{0}\t{1}", kvp.Value, kvp.Key)); } } }