Return-Path: X-Original-To: apmail-uima-user-archive@www.apache.org Delivered-To: apmail-uima-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA57C1056A for ; Thu, 5 Sep 2013 18:37:49 +0000 (UTC) Received: (qmail 21379 invoked by uid 500); 5 Sep 2013 18:37:49 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 21327 invoked by uid 500); 5 Sep 2013 18:37:43 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Delivered-To: moderator for user@uima.apache.org Received: (qmail 24520 invoked by uid 99); 5 Sep 2013 17:59:42 -0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of richard.eckart@gmail.com designates 74.125.83.47 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=04IU+GSS9ZUL19y692T92RVJqTUvVRmfgsk6VdsaXRw=; b=BzRATcOqSyZZkdGIUQq8LgvMmFiNGGSmI6pVN5RsG17wy6UZwbIEa7NNdeQZB9CDKc XXV1ARCzgMqGGFdGvM4mkDa6e1IDyzV+GrvohbwCX5sUJ+sns+yMWVdZxJRiHWpm/REj ZcgXQcTZZ3+BrE2sUuUiSrjVnp9IU0Y/kvbFopcgi2wdYluf4pTNxk2Eh1wt87uLKVdJ FSblMhPmIQrCBWV3vlOCrli9zoku040flVvx3PwokahjKGzYea9LJ83NGGmrYUpL2Wh/ vJR76IQAUUViW9JPq82aSPnkxdMDmY8WSduN42o6WzJ4LHpu2oglVE7fRBb0jjUEb4/1 bbEA== X-Received: by 10.14.241.141 with SMTP id g13mr3957266eer.75.1378403954981; Thu, 05 Sep 2013 10:59:14 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: AnalysisEngine.processAndOutputNewCASes(...) in case of JCasMultiplier returns 0 JCases From: Richard Eckart de Castilho In-Reply-To: <2D3EBE0F-14AB-49A3-AF17-2E7705375D54@gmail.com> Date: Thu, 5 Sep 2013 19:59:11 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <77512835-C0FE-4B1E-9DE7-CEDF3AD26E0A@gmail.com> References: <2D3EBE0F-14AB-49A3-AF17-2E7705375D54@gmail.com> To: user@uima.apache.org X-Mailer: Apple Mail (2.1508) X-Virus-Checked: Checked by ClamAV on apache.org Hi Artem, did you try asking the AggregateBuilder for a description, calling getOperationalProperties().setOutputsNewCASes(true) on the description and then creating the engine? I have an apparently working piece of code looking along these lines // The part starting with a splitter and ending with a merger has to be = in its own // aggregate. The flow controller of the aggregate has to drop the = intermediate CASes. FlowControllerDescription fcd =3D = createFlowControllerDescription(FixedFlowController.class, FixedFlowController.PARAM_ACTION_AFTER_CAS_MULTIPLIER, "drop"); AnalysisEngineDescription embedded =3D createEngineDescription(fcd, = splitter, tokenizer, merger); // The final merged CAS, however, needs to be returned from the = aggregate = embedded.getAnalysisEngineMetaData().getOperationalProperties().setOutputs= NewCASes(true); // Need to wrap into another aggregate because runPipeline has no = immediate support for // flow control AnalysisEngineDescription pipelineDesc =3D = createEngineDescription(sentenceDetector, embedded, consumer); SimplePipeline.runPipeline(createReaderDescription(=85), pipelineDesc); Cheers, -- Richard On 30.08.2013, at 23:32, Artem Vovk wrote: > Hi, >=20 > I wanted to write a test for MyJCasMultiplier, to check how many = JCases are created. Here is my code: >=20 > AnalysisEngineDescription segmenter =3D = createEngineDescription(BreakIteratorSegmenter.class); >=20 > AnalysisEngineDescription multiplier =3D = createEngineDescription(MyJCasMultiplier.class); > =09 > AggregateBuilder ab =3D new AggregateBuilder(); > ab.add(segmenter); > ab.add(multiplier); >=20 > AnalysisEngine engine =3D ab.createAggregate(); > = engine.getAnalysisEngineMetaData().getOperationalProperties().setOutputsNe= wCASes(true); >=20 > JCas jCas =3D engine.newJCas(); > jCas.setDocumentText(testString); > JCasIterator it =3D engine.processAndOutputNewCASes(jCas); >=20 > The problem is that engine.processAndOutputNewCASes(jCas) returns = always 0 JCases, but I know it should be more :) Did I miss something = here or it is a framework issue? >=20 > Best, > Artem