本文整理汇总了Java中com.google.common.collect.ImmutableMultimap.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableMultimap.keySet方法的具体用法?Java ImmutableMultimap.keySet怎么用?Java ImmutableMultimap.keySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.ImmutableMultimap
的用法示例。
在下文中一共展示了ImmutableMultimap.keySet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: trueMain
import com.google.common.collect.ImmutableMultimap; //导入方法依赖的package包/类
private static void trueMain(String[] argv) throws IOException {
final Parameters params = Parameters.loadSerifStyle(new File(argv[0]));
final File inputStore = params.getExistingDirectory("inputStore");
final File outputStore = params.getCreatableDirectory("outputStore");
final SystemOutputStore2016 input = SystemOutputStore2016.open(inputStore);
final SystemOutputStore2016 output = SystemOutputStore2016.openOrCreate(outputStore);
final ImmutableSet<KBPRealis> linkableRealises =
ImmutableSet.of(KBPRealis.Actual, KBPRealis.Other);
final Predicate<Response> realisIsLinkable =
compose(in(linkableRealises), ResponseFunctions.realis());
// collect all the surviving filtering
final ImmutableSet.Builder<DocEventFrameReference> survivingIDsB = ImmutableSet.builder();
for (final Symbol docID : input.docIDs()) {
final DocumentSystemOutput2015 oldOutput = input.read(docID);
final ResponseLinking filtered =
oldOutput.linking().copyWithFilteredResponses(realisIsLinkable);
for (final String surviving : filtered.responseSetIds().get().keySet()) {
survivingIDsB.add(DocEventFrameReference.of(docID, surviving));
}
final DocumentSystemOutput2015 newOutput =
DocumentSystemOutput2015.from(oldOutput.arguments(), filtered);
output.write(newOutput);
}
final ImmutableSet<DocEventFrameReference> survivingFrames = survivingIDsB.build();
// remove those from the CorpusEventLinking
final CorpusEventLinking.Builder newCorpusLinkingB = CorpusEventLinking.builder();
final ImmutableMultimap<CorpusEventFrame, DocEventFrameReference> corpusEventToDocEvent =
input.readCorpusEventFrames().docEventsToCorpusEvents().inverse();
for (final CorpusEventFrame cef : corpusEventToDocEvent.keySet()) {
final ImmutableSet<DocEventFrameReference> survivingDocEvents =
FluentIterable.from(corpusEventToDocEvent.get(cef)).filter(in(survivingFrames)).toSet();
if (survivingDocEvents.size() > 0) {
final CorpusEventFrame res = CorpusEventFrame.of(cef.id(), survivingDocEvents);
newCorpusLinkingB.addCorpusEventFrames(res);
}
}
output.writeCorpusEventFrames(newCorpusLinkingB.build());
}