- 1
- 2
- 3
- 4
- 5
foreach(string s in File.ReadAllText(input_text).Replace('ё', 'е').ToLower().Split(new char[] { ',', ' ', '.', '\t', '\r', '\n', '-', '?', '!', '\\', '/', ':', ';', '<', '>', '\'', '\"', '(', ')' }, StringSplitOptions.RemoveEmptyEntries).
AsParallel().Where<string>(s => (s.Length == 4)).GroupBy(x => x).Select(g => new { Value = g.Key, Count = g.Count() }). OrderByDescending(x => x.Count).Select(f => (f.Value + ' ' + f.Count.ToString())).ToArray())
{
Console.WriteLine(s);
}
Follow us!