uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank <frankcas...@gmail.com>
Subject Re: Opening a Cas.xmi file and using it to create a CAS object
Date Wed, 12 Jan 2011 02:36:06 GMT
Timur,

Here is what I did to load an existing cas from its cas.xmi file, also using
its Type Description file.

         //get typeSystemDescription
         Object descriptor = UIMAFramework.getXMLParser().parse(new
XMLInputSource(inputTypeSystemFile));
         // instantiate CAS to get type system. Also build style. map file
if there is none.
         TypeSystemDescription tsDesc = (TypeSystemDescription) descriptor;
         tsDesc.resolveImports();
         CAS cas = CasCreationUtils.createCas(tsDesc, null, new
FsIndexDescription[0]);

         SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
         XmiCasDeserializer xmiCasDeserializer = new
XmiCasDeserializer(cas.getTypeSystem());
         parser.parse(inputCasFile, xmiCasDeserializer.getXmiCasHandler(cas,
true));

Frank,

On Sun, Dec 19, 2010 at 1:21 PM, Timur <acidrat@gmail.com> wrote:

> Frank <frankcascio@...> writes:
>
> >
> > Hi,
> >
> > I am currently trying to load CAS xmi files and create CAS objects, but I
> > can't see how to do it.
>
>
>
> Have you managed to work it out?
>
> I am trying to do exact the same thing, and i dont have any luck neither.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message