Package org.apache.ctakes.typesystem.type.structured

Examples of org.apache.ctakes.typesystem.type.structured.DocumentID


      // Not needed for production use - add documentId that was collected
      // in the CAS initializer
      // if (isWindows()) {
       FSIterator<TOP> documentIDIterator = indexes.getAllIndexedFS(DocumentID.type);
      if (documentIDIterator.hasNext()) {
        DocumentID did = (DocumentID) documentIDIterator.next();
        casConsumerOffSetData.append(did.getDocumentID());

      }
      // }

      // add clinic number, etc for local run
View Full Code Here


        {
          ((DocumentAnnotation)jcas.getDocumentAnnotationFs()).setLanguage(iv_language);
        }
       
       
        DocumentID documentIDAnnotation = new DocumentID(jcas);
        documentIDAnnotation.setDocumentID(id);
        documentIDAnnotation.addToIndexes();

      }
      catch (ArrayIndexOutOfBoundsException aioobe) {
        iv_logger.log(Level.ERROR, "Radiology input file corrupt or some record row contents are not valid.");
        throw new CollectionException(aioobe);
View Full Code Here

  }

  @Override
  public void process(JCas jCas) throws AnalysisEngineProcessException
  {
    DocumentID documentId = JCasUtil.selectSingle(jCas, DocumentID.class);
    if (documentId != null)
    {
      logger.debug("processing next doc: " + documentId.getDocumentID());
    } else
    {
      logger.warn("processing next doc (doc id is null)");
    }
   
View Full Code Here

  public static class DocumentIDAnnotator extends JCasAnnotator_ImplBase {

    @Override
    public void process(JCas jCas) throws AnalysisEngineProcessException {
      String documentID = new File(ViewURIUtil.getURI(jCas)).getPath();
      DocumentID documentIDAnnotation = new DocumentID(jCas);
      documentIDAnnotation.setDocumentID(documentID);
      documentIDAnnotation.addToIndexes();
    }
View Full Code Here

            Pairs propAnnot = new Pairs(plaintextView);
            Map metaDataMap = dmd.getMetaData();
           
            String docID = (String)metaDataMap.get(ClinicalNotePreProcessor.MD_KEY_DOC_ID);
          if (docID!=null) {
              DocumentID newDocId = new DocumentID(plaintextView);
              newDocId.setDocumentID(docID);
              newDocId.addToIndexes();
         
          }
           
            FSArray fsArr = new FSArray(plaintextView, metaDataMap.size());
            Iterator keyItr = metaDataMap.keySet().iterator();
View Full Code Here

        //open input stream to file
          File file = (File)iv_files.get(iv_currentIndex);
          fileInputStream = new FileInputStream(file);
          fileReader = new BufferedReader(new InputStreamReader(fileInputStream));

          DocumentID documentIDAnnotation = new DocumentID(jcas);
        String docID = createDocID(file);
        documentIDAnnotation.setDocumentID(docID);
        documentIDAnnotation.addToIndexes();

          //if there's a CAS Initializer, call it 
      if (getCasInitializer() != null)
      {
        getCasInitializer().initializeCas(fileReader, aCAS)
View Full Code Here

                    // No CAS Initiliazer, so set document text ourselves.
                    // put document in CAS (assume CAS)
                    cas.getJCas().setDocumentText(document);
                }

                DocumentID docIdAnnot = new DocumentID(cas
                        .getJCas());
                docIdAnnot.setDocumentID(getDocumentID(rs));
                docIdAnnot.addToIndexes();

                logger.info("Reading document with ID="
                        + docIdAnnot.getDocumentID());
            } catch (Exception e)
            {
                logger.error("CasInitializer failed to process document: ");
                logger.error(document);
                throw e;
View Full Code Here

  {
    try
    {
       JFSIndexRepository indexes = jcas.getJFSIndexRepository();
       FSIterator<TOP> documentIDIterator = indexes.getAllIndexedFS(DocumentID.type);
       DocumentID documentIDAnnotation = (DocumentID) documentIDIterator.next();
       String documentID = documentIDAnnotation.getDocumentID();
       return documentID;
    }
    catch(Exception e) { return null;}
  }
View Full Code Here

        {
//          ((DocumentAnnotation)jcas.getDocumentAnnotationFs()).setLanguage(iv_language);
        }
       
       
        DocumentID documentIDAnnotation = new DocumentID(jcas);
        documentIDAnnotation.setDocumentID(id);
        documentIDAnnotation.addToIndexes();

      }
      catch (CASException e)
      {
        throw new CollectionException(e);
View Full Code Here

    for (String knowtatorTextDirectoryPath : args) {
      File knowtatorTextDirectory = new File(knowtatorTextDirectoryPath);
      for (File textFile : knowtatorTextDirectory.listFiles()) {
        JCas jCas = engine.newJCas();
        jCas.setDocumentText(Files.toString(textFile, Charsets.US_ASCII));
        DocumentID documentID = new DocumentID(jCas);
        documentID.setDocumentID(textFile.toURI().toString());
        documentID.addToIndexes();
        engine.process(jCas);
        documentID.setDocumentID(textFile.getName());
        xWriter.process(jCas);
      }
    }

  }
View Full Code Here

TOP

Related Classes of org.apache.ctakes.typesystem.type.structured.DocumentID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.