Examples of JCasIterable


Examples of org.uimafit.pipeline.JCasIterable

    {
      map.put("historyOf", historyStats);
    }

    // run on existing output that has both system (or instance gathering) and gold
    for (JCas jCas : new JCasIterable(collectionReader, aggregate)) {
     
//      printViewNames("Views found by JCasIterable:", jCas);
     
      JCas goldView;
      try {
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

      }
    };
    Function<BinaryTextRelation, String> getOutcome = AnnotationStatistics.annotationToFeatureValue("category");

    AnnotationStatistics<String> stats = new AnnotationStatistics<String>();
    JCasIterable jcasIter =new JCasIterable(collectionReader, aggregateBuilder.createAggregate());
    JCas jCas = null;
    while(jcasIter.hasNext()) {
      jCas = jcasIter.next();
      JCas goldView = jCas.getView(GOLD_VIEW_NAME);
      JCas systemView = jCas.getView(CAS.NAME_DEFAULT_SOFA);
      Collection<BinaryTextRelation> goldRelations = JCasUtil.select(
          goldView,
          BinaryTextRelation.class);
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    builder.add(AnalysisEngineFactory.createPrimitiveDescription(
            SentenceDetector.class,
            SentenceDetector.SD_MODEL_FILE_PARAM,
            "org/apache/ctakes/core/sentdetect/sd-med-model.zip"));
    builder.add(AnalysisEngineFactory.createPrimitiveDescription(TokenizerAnnotatorPTB.class));
    for (JCas jCas : new JCasIterable(reader, builder.createAggregate())) {
      for (EventMention event : JCasUtil.select(jCas, EventMention.class)) {
        List<BaseToken> tokens = JCasUtil.selectCovered(jCas, BaseToken.class, event);
        if (tokens.size() > 1) {
          System.err.printf(
              "Multi-token event \"%s\" in %s\n",
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

        XMIReader.PARAM_XMI_DIRECTORY,
        options.getXMIDirectory()));

    CounterMap<String> timeClassCounts = new CounterMap<String>();
   
    JCasIterable casIter = new JCasIterable(reader, aggregateBuilder.createAggregate());
    while(casIter.hasNext()){
      JCas jcas = casIter.next();
      JCas goldView = jcas.getView(Evaluation_ImplBase.GOLD_VIEW_NAME);
      Collection<TemporalTextRelation> rels = JCasUtil.select(goldView, TemporalTextRelation.class);
      for(BinaryTextRelation rel : rels){
        Annotation arg1 = rel.getArg1().getArgument();
        Annotation arg2 = rel.getArg2().getArgument();
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    for(String propertyName : PROPERTY_NAMES){
      statsMap.put(propertyName, new AnnotationStatistics<String>());
    }

    for (JCas jCas : new JCasIterable(collectionReader, aggregateBuilder.createAggregate())) {
      JCas goldView = jCas.getView(GOLD_VIEW_NAME);
      JCas systemView = jCas.getView(CAS.NAME_DEFAULT_SOFA);
      String text = goldView.getDocumentText();
      for (Segment segment : JCasUtil.select(jCas, Segment.class)) {
        if (!THYMEData.SEGMENTS_TO_SKIP.contains(segment.getId())) {
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

          AnalysisEngineFactory.createPrimitiveDescription(SHARPKnowtatorXMLReader.class),
          CAS.NAME_DEFAULT_SOFA,
          GOLD_VIEW_NAME);

      // write out an XMI for each file
      for (JCas jCas : new JCasIterable(reader, builder.createAggregate())) {
        JCas goldView = jCas.getView(GOLD_VIEW_NAME);
        String documentID = DocumentIDAnnotationUtil.getDocumentID(goldView);
        if (documentID == null) {
          throw new IllegalArgumentException("No documentID for CAS:\n" + jCas);
        }
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    this.outputDir = outputDir;
    this.classOfT = getClassOfT();
  }
 
  public void process() throws UIMAException, IOException{
    JCasIterable casIter = new JCasIterable(reader, ae);
    while(casIter.hasNext()){
      JCas jcas = casIter.next();
      String docId = DocumentIDAnnotationUtil.getDocumentID(jcas);
     
      // extract info from cas
      processCas(jcas, outputDir + File.separator + docId);
    }
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

      CollectionReader reader = CollectionReaderFactory.createCollectionReader(
              XMIReader.class,
              XMIReader.PARAM_FILES,
              paths);
        
      JCasIterable casIter = new JCasIterable(reader);
      while(casIter.hasNext()){
        JCas jcas = casIter.next();
        processDocument(jcas);
      }
      out.close();
  }
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    CollectionReader reader = CollectionReaderFactory.createCollectionReader(
            XMIReader.class,
            XMIReader.PARAM_FILES,
            paths);
      
    JCasIterable casIter = new JCasIterable(reader);
    while(casIter.hasNext()){
      JCas jcas = casIter.next();
//      String docId = DocumentIDAnnotationUtil.getDocumentID(jcas);
//      out.println("## Document id: " + docId);
      processDocument(jcas);
    }
    out.close();
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    AnalysisEngine sectionAnnotator = AnalysisEngineFactory
        .createPrimitive(CDASegmentAnnotator.class, typeSystem);
    AnalysisEngine dumpOutput = AnalysisEngineFactory.createPrimitive(
        DumpOutputAE.class, typeSystem);
    // SimplePipeline.runPipeline(reader, sectionAnnotator, dumpOutput);
    JCasIterable casIter = new JCasIterable(reader, sectionAnnotator,
        dumpOutput);
    final String expected_hpi_section = "2.16.840.1.113883.10.20.22.2.20";
    final int expected_begin = 1634;
    final int expected_end = 1696;
    boolean section_exists = false;
    int section_begin = 0;
    int section_end = 0;

    while (casIter.hasNext()) {
      JCas jCas = casIter.next();
      for (Segment segment : JCasUtil.select(jCas, Segment.class)) {
        if (expected_hpi_section.equalsIgnoreCase(segment.getId())) {
          section_exists = true;
          section_begin = segment.getBegin();
          section_end = segment.getEnd();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.