Package org.apache.ctakes.smokingstatus.i2b2.type

Examples of org.apache.ctakes.smokingstatus.i2b2.type.RecordSentence


        // all sentences should be added to one list in iv_entryIndexMap
        ClassifiableEntry entry = (ClassifiableEntry) iv_procEntryList
            .get(iv_classifiableIdx);
        // add object to CAS that captures entry data
        RecordSentence rs = new RecordSentence(jcas_local);
        rs.setRecordID(entry.iv_recordID);

        /**
         * To optimize processing, pcs classifier step will process just
         * the sentence that was classified as "Known" by
         * KURuleBasedClassifier. Document Text is thus restricted to
         * contain Sentence Text and NOT the complete document text.
         * Thus, begin and end cannot be directly copied from
         * entry.iv_begin and entry.iv_end
         */
        rs.setBegin(0);
        rs.setRecordTextBegin(0);
        rs.setEnd(entry.iv_text.length());
        rs.setRecordTextEnd(entry.iv_text.length());

        // No CAS Initiliazer
        jcas_local.setDocumentText(entry.iv_text);

        // get segment for the sentence, assume boundaries to be that of
        // the sentence
        Segment sa = getSegment(entry);
        if (sa != null) {
          Segment copy_sa = new Segment(jcas_local);
          copy_sa.setBegin(rs.getBegin());
          copy_sa.setEnd(rs.getEnd());
          copy_sa.setId(sa.getId());
          copy_sa.addToIndexes();
        } else {
          if (iv_logger.isDebugEnabled())
            iv_logger.error("Invalid Segment for sentence ["
                + rs.getCoveredText() + "]");
        }

        // assign classification value if applicable
        // this only happens when a Truth data file was specified
        if (entry.iv_classification != null) {
          rs.setClassification(entry.iv_classification);
        }
        rs.addToIndexes();

        taeStep1.process(jcas_local);

        if (isSmokingStatusKnown(jcas_local))
          taeStep2.process(jcas_local);
View Full Code Here

TOP

Related Classes of org.apache.ctakes.smokingstatus.i2b2.type.RecordSentence

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.