/** * * @param aJCas * the target JCas * @param aFile * the file to read from * @throws IOException * if there is a problem reading the file * @deprecated Use {@link CasIOUtils#load(java.net.URL, CAS)} instead. */ @Deprecated public static void readXCas(JCas aJCas, File aFile) throws IOException { CasIOUtil.readXCas(aJCas.getCas(), aFile); }
/** * This method loads the contents of an XMI or XCAS file into the given CAS. The file type is * detected by the extension. * * @param aCas * the target CAS * @param aFile * the file to read from * @throws IOException * if there is a problem reading the file * @deprecated Use {@link CasIOUtils#load(java.net.URL, CAS)} instead. */ @Deprecated public static void readCas(CAS aCas, File aFile) throws IOException { String lowerCaseFileName = aFile.getName().toLowerCase(); if (lowerCaseFileName.endsWith(".xmi")) { CasIOUtil.readXmi(aCas, aFile); } else if (lowerCaseFileName.endsWith(".xcas")) { CasIOUtil.readXCas(aCas, aFile); } else { throw new IllegalArgumentException("Unknown file extension: [" + aFile + "] "); } }
entry[0] = xcas.getName(); jcas = Typesystem.getJCas(TYPESYSTEM); CasIOUtil.readXCas(jcas, xcas); Collection<Error> errors = JCasUtil.select(jcas, Error.class); for (Error error : errors) {
CasIOUtil.readXCas(jcas, XCASFile); input.add(new XCASRelationTuple(jcas, readRawRelations, relFile.getName().replace(".rel", "")));