/** * Generates the XML content for the coreference chain object. */ private static boolean addCorefGraphInfo (Options options, Element corefInfo, List<CoreMap> sentences, Map<Integer, CorefChain> corefChains, String curNS) { boolean foundCoref = false; for (CorefChain chain : corefChains.values()) { if (!options.printSingletons && chain.getMentionsInTextualOrder().size() <= 1) continue; foundCoref = true; Element chainElem = new Element("coreference", curNS); CorefChain.CorefMention source = chain.getRepresentativeMention(); addCorefMention(options, chainElem, curNS, sentences, source, true); for (CorefChain.CorefMention mention : chain.getMentionsInTextualOrder()) { if (mention == source) continue; addCorefMention(options, chainElem, curNS, sentences, mention, false); } corefInfo.appendChild(chainElem); } return foundCoref; }
/** * Generates the XML content for the coreference chain object. */ private static boolean addCorefGraphInfo (Options options, Element corefInfo, List<CoreMap> sentences, Map<Integer, CorefChain> corefChains, String curNS) { boolean foundCoref = false; for (CorefChain chain : corefChains.values()) { if (!options.printSingletons && chain.getMentionsInTextualOrder().size() <= 1) continue; foundCoref = true; Element chainElem = new Element("coreference", curNS); CorefChain.CorefMention source = chain.getRepresentativeMention(); addCorefMention(options, chainElem, curNS, sentences, source, true); for (CorefChain.CorefMention mention : chain.getMentionsInTextualOrder()) { if (mention == source) continue; addCorefMention(options, chainElem, curNS, sentences, mention, false); } corefInfo.appendChild(chainElem); } return foundCoref; }
/** * Generates the XML content for the coreference chain object */ private static boolean addCorefGraphInfo (Options options, Element corefInfo, List<CoreMap> sentences, Map<Integer, CorefChain> corefChains, String curNS) { boolean foundCoref = false; for (CorefChain chain : corefChains.values()) { if (!options.printSingletons && chain.getMentionsInTextualOrder().size() <= 1) continue; foundCoref = true; Element chainElem = new Element("coreference", curNS); CorefChain.CorefMention source = chain.getRepresentativeMention(); addCorefMention(options, chainElem, curNS, sentences, source, true); for (CorefChain.CorefMention mention : chain.getMentionsInTextualOrder()) { if (mention == source) continue; addCorefMention(options, chainElem, curNS, sentences, mention, false); } corefInfo.appendChild(chainElem); } return foundCoref; }