/** Serializes the CorefChain objects * * @param chains all clusters in a doc * @param pw the buffer */ private static void saveCorefChains(Map<Integer, CorefChain> chains, PrintWriter pw) { if(chains == null) { pw.println(); return; } // how many clusters pw.println(chains.size()); // save each cluster for (Map.Entry<Integer, CorefChain> integerCorefChainEntry : chains.entrySet()) { // cluster id + how many mentions in the cluster saveCorefChain(pw, integerCorefChainEntry.getKey(), integerCorefChainEntry.getValue()); } // an empty line at end pw.println(); }
/** Serializes the CorefChain objects * * @param chains all clusters in a doc * @param pw the buffer */ private static void saveCorefChains(Map<Integer, CorefChain> chains, PrintWriter pw) { if(chains == null) { pw.println(); return; } // how many clusters pw.println(chains.size()); // save each cluster for (Map.Entry<Integer, CorefChain> integerCorefChainEntry : chains.entrySet()) { // cluster id + how many mentions in the cluster saveCorefChain(pw, integerCorefChainEntry.getKey(), integerCorefChainEntry.getValue()); } // an empty line at end pw.println(); }
/** Serializes the CorefChain objects * * @param chains all clusters in a doc * @param pw the buffer */ private static void saveCorefChains(Map<Integer, CorefChain> chains, PrintWriter pw) { if(chains == null) { pw.println(); return; } // how many clusters pw.println(chains.size()); // save each cluster for(Integer cid: chains.keySet()) { // cluster id + how many mentions in the cluster CorefChain cluster = chains.get(cid); saveCorefChain(pw, cid, cluster); } // an empty line at end pw.println(); }