/** * This method creates a new JCas and loads the contents of an XMI or XCAS file into it. * * @param fileName * a file name for the serialized CAS data * @param typeSystemDescription * a type system description to initialize the JCas * @return a new JCas * @throws UIMAException * if the JCas could not be initialized * @throws IOException * if there is a problem reading the file */ public static JCas createJCas(String fileName, TypeSystemDescription typeSystemDescription) throws UIMAException, IOException { JCas jCas = createJCas(typeSystemDescription); CasIOUtil.readJCas(jCas, new File(fileName)); return jCas; } }