public TraversableOnce<OUT> apply(IN v) { return JavaConversions.iterableAsScalaIterable(f.apply(v)); } };
/** * @param source * @return the corresponding JProducer */ public static <T> JProducer<Memory, T> source(Iterable<T> source) { return JProducers.source(new Source<Memory, TraversableOnce<T>, T>(JavaConversions.iterableAsScalaIterable(source))); }
private static void printCurrentAssignment(ZkUtils zkUtils, List<String> specifiedTopics) { Seq<String> topics = specifiedTopics != null ? JavaConversions.iterableAsScalaIterable(specifiedTopics).toSeq() : zkUtils.getAllTopics(); System.out.println("CURRENT ASSIGNMENT:"); System.out.println( zkUtils.formatAsReassignmentJson(zkUtils.getReplicaAssignmentForTopics( topics))); }
/** the {@link OdinDocument} that represents the jCas */ public OdinDocument create() { OdinDocument document = new OdinDocument(sentenceFactory.create()); document.text_$eq(Some.apply(jCas.getDocumentText())); int chainId = 0; List<CorefMention> mentions = new ArrayList<>(); for (Entry<ReferenceTarget, Collection<Entity>> coref : referentMap.asMap().entrySet()) { for (Entity entity : coref.getValue()) { Collection<Sentence> collection = entityIndex.get(entity); if (!collection.isEmpty()) { OdinSentence sentence = document.findSentence(collection.iterator().next()); mentions.add(sentence.corefMention(entity, chainId)); } } chainId++; } CorefChains chains = CorefChains.apply(JavaConversions.iterableAsScalaIterable(mentions)); document.coreferenceChains_$eq(Option.apply(chains)); return document; } }
/** the {@link OdinDocument} that represents the jCas */ public OdinDocument create() { OdinDocument document = new OdinDocument(sentenceFactory.create()); document.text_$eq(Some.apply(jCas.getDocumentText())); int chainId = 0; List<CorefMention> mentions = new ArrayList<>(); for (Entry<ReferenceTarget, Collection<Entity>> coref : referentMap.asMap().entrySet()) { for (Entity entity : coref.getValue()) { Collection<Sentence> collection = entityIndex.get(entity); if (!collection.isEmpty()) { OdinSentence sentence = document.findSentence(collection.iterator().next()); mentions.add(sentence.corefMention(entity, chainId)); } } chainId++; } CorefChains chains = CorefChains.apply(JavaConversions.iterableAsScalaIterable(mentions)); document.coreferenceChains_$eq(Option.apply(chains)); return document; } }
_job, RDDInfo.fromRdd(training), iterableAsScalaIterable(Arrays.asList("treeAggregate")));