ABB.Swum.Utilities.LibFileLoader.WriteWordCount C# (CSharp) Method

WriteWordCount() public static method

Writes a word count dictionary to a file. Each dictionary entry is written in the format "[count] [word]".
public static WriteWordCount ( int>.Dictionary wordCount, string path ) : void
wordCount int>.Dictionary The word count dictionary to write.
path string The file to write to.
return void
        public static void WriteWordCount(Dictionary<string, int> wordCount, string path)
        {
            using (StreamWriter file = new StreamWriter(path, false, Encoding.UTF8))
            {
                foreach (var kvp in wordCount.OrderBy(v => v.Key))
                {
                    file.WriteLine("{0} {1}", kvp.Value, kvp.Key);
                }
            }
        }