@Override public String toString() { String s = "CORPUS \"" + Corpus.getName() + "\"\n"; for (String depRelationString : depRelationWordCountMap.keySet()) { HashMap<String, Long> wordCountMap = depRelationWordCountMap.get(depRelationString); s += "DEPRELATION \"" + depRelationString + "\"\n"; int i = 0; for (String contextWord : wordCountMap.keySet()) { long count = wordCountMap.get(contextWord); s += count + "\t" + contextWord + "\n"; if (++i >= 5) break; } } return s; }