A CasMultiplier component has a CasPool from which empty CASes can be checked out and returned to the pool when finished. See http://uima.apache.org/d/uimaj-2.3.1/tutorials_and_users_guides.html#ugr.tug.cm
Eddie On Mon, Jul 25, 2011 at 1:38 PM, James Jichun Zhu <[email protected]> wrote: > I am implementing my work as an analysis engine component so that it can be > plugged in a CPE for processing multiple input files. If I am to do my work > as an application, then I imagine I will have to handle looping through the > individual input files. Maybe there are some other things I have to worry > about. I have not tried it that way. Maybe I should. But if there is > something similar to CAS.reset() that I can use to clear the CAS within my > AE component, that would save me from a lot of trouble. Is there such a > thing? > > James > > > On 7/25/2011 10:12 AM, Marshall Schor wrote: >> >> Yes, you are right, the CAS Reset is for an application, not for an >> annotator. >> >> Is there any reason you can't do your work as an application? It would >> seem to >> "fit" there, better. >> >> -Marshall >> >> On 7/25/2011 11:32 AM, James Jichun Zhu wrote: >>> >>> Thanks, Burn. What I found was that the XMI files previous generated >>> bears the >>> sofa ID "_InitialView", and when I manually change it to a specific view >>> name, >>> I am able to extract the objects from the XMI file into the CAS >>> underlying >>> that specific view. So, you are probably right about "it re-creates a >>> complete >>> CAS matching the one that had been serialized". >>> >>> In reality, because I need to load objects from two XMI files into two >>> separate collections, I cannot always manually update the XMI's sofa ID >>> to two >>> separate view names in order for them to be loaded into two separate >>> CASes. So >>> you are right again about loading them into the same CAS in two separate >>> steps. >>> >>> However, I ran into trouble on how to clear the CAS after deserializing >>> the >>> first XMI file. I tried the reset() method but it seems to be intended >>> for >>> application (not 100% sure what it means), not for being used internally >>> within an analysis engine component. Any other ways to get it done? >>> >>> Really appreciate all the help here. >>> >>> James >>> >>> >>> On 7/22/11 2:19 PM, Burn Lewis wrote: >>>> >>>> XmiCasDeserialize operates on a CAS, not a View. It re-creates a >>>> complete >>>> CAS matching the one that had been serialized. If you want to compare >>>> the >>>> contents of two CASes (two XMI files) you'll have to deserialize them >>>> one-by-one. You could extract the information of interest from the 1st >>>> before deserializing the 2nd file into the same CAS. >>>> >>>> Burn. >>>> >
