uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Eckart de Castilho <eckar...@tk.informatik.tu-darmstadt.de>
Subject Re: XmiCasSerialization, XmiCasDeserialization and XmiSerializationSharedData
Date Thu, 16 Jun 2011 16:31:20 GMT
> Thanks, Richard.   So by configuring the same type system, what do you mean? 

Using a both UIMA (CasCreationUtils) and uimaFIT (TypeSystemDescriptionFactory), you could
do something like this:

  CAS cas = CasCreationUtils.createCas(TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath("TypeSystem.xml"),
null, null);
  XmiCasDeserializer.deserialize(new FileInputStream("file.xmi"), cas);

If you want to worry a bit less about configuring type systems, you might want to have a look
at uimaFIT's type discovery capability.
This capability basically allows you to "just have your types on the classpath" and then use
code like this:

  CAS cas = CasCreationUtils.createCas(TypeSystemDescriptionFactory.createTypeSystemDescription(),
null, null);
  XmiCasDeserializer.deserialize(new FileInputStream("file.xmi"), cas);

Here the createTypeSystemDescription() automatically scans the classpath and adds all types
it finds to the type system. The 
following page details how to set up this feature:




Richard Eckart de Castilho
Technical Lead
Ubiquitous Knowledge Processing Lab 
FB 20 Computer Science Department      
Technische Universit├Ąt Darmstadt 
Hochschulstr. 10, D-64289 Darmstadt, Germany 
phone [+49] (0)6151 16-7477, fax -5455, room S2/02/B117
Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de

View raw message