本文整理汇总了Java中org.apache.uima.jcas.JCas.getView方法的典型用法代码示例。如果您正苦于以下问题:Java JCas.getView方法的具体用法?Java JCas.getView怎么用?Java JCas.getView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.uima.jcas.JCas
的用法示例。
在下文中一共展示了JCas.getView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.apache.uima.jcas.JCas; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
// TypeSystemDescription tsd = TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath("../desc/TypeSystem.xml");
JCas jcas = JCasFactory.createJCas();
jcas.setDocumentText("Patient is a 30-year-old man named Leroy Butler from Green Bay, WI.");
AnalysisEngineDescription aed = AnalysisEngineFactory.createEngineDescription(MistAnalysisEngine.class,
MistAnalysisEngine.PARAM_MODEL_PATH,
"SHARP/model/model");
SimplePipeline.runPipeline(jcas, aed);
for(Annotation annot : JCasUtil.select(jcas, Annotation.class)){
System.out.println("Found annotation: " + annot.getCoveredText());
}
JCas deidView = jcas.getView(MistAnalysisEngine.DEID_VIEW_NAME);
System.out.println("Deidentified version:");
System.out.println(deidView.getDocumentText());
}
示例2: process
import org.apache.uima.jcas.JCas; //导入方法依赖的package包/类
@Override
public void process( final JCas jcas ) throws AnalysisEngineProcessException {
final String patient = Long.toString( SourceMetadataUtil.getPatientNum( jcas ) );
final SourceData sourceData = SourceMetadataUtil.getSourceData( jcas );
final String encounter = sourceData==null?"null":sourceData.getSourceEncounterId();
final String providerId = sourceData==null?"null":SourceMetadataUtil.getProviderId( sourceData );
// source date not used ???
// final String sourceDate = sourceData.getSourceOriginalDate();
JCas deidView = null;
try{
deidView = jcas.getView(DEID_VIEW);
}catch(CASException e){
throw new AnalysisEngineProcessException(e);
}
final Collection<String> conceptLines = createConceptLines( deidView, patient, encounter, providerId );
final File outputFile = new File( _outputRootDir, encounter );
saveAnnotations( outputFile, conceptLines );
}