/// <summary> /// A simple String representation of this TwoDimensionalCounter, which has /// the String representation of each key pair /// on a separate line, followed by the count for that pair. /// </summary> /// <remarks> /// A simple String representation of this TwoDimensionalCounter, which has /// the String representation of each key pair /// on a separate line, followed by the count for that pair. /// The items are tab separated, so the result is a tab-separated value (TSV) /// file. Iff none of the keys contain spaces, it will also be possible to /// treat this as whitespace separated fields. /// </remarks> public override string ToString() { StringBuilder buff = new StringBuilder(); foreach (K1 key1 in map.Keys) { IntCounter <K2> c = GetCounter(key1); foreach (K2 key2 in c.KeySet()) { double score = c.GetCount(key2); buff.Append(key1).Append("\t").Append(key2).Append("\t").Append(score).Append("\n"); } } return(buff.ToString()); }