private void UpdateGramResult(string gram, Dictionary <string, int> countDict, MinSmallDictionary resultDict) { int count = 0; if (countDict.TryGetValue(gram, out count)) { count += 1; } else { count = 1; } countDict[gram] = count; resultDict.Add(gram, count); }