org.apache.uima.cas.CAS.getSofa()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(74)

本文整理了Java中org.apache.uima.cas.CAS.getSofa()方法的一些代码示例,展示了CAS.getSofa()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CAS.getSofa()方法的具体详情如下:
包路径:org.apache.uima.cas.CAS
类名称:CAS
方法名:getSofa

CAS.getSofa介绍

[英]Get the Sofa feature structure associated with this CAS view.
[中]获取与此CAS视图关联的沙发要素结构。

代码示例

代码示例来源:origin: apache/uima-uimaj

/**
  * @return the sofa.
  */
 public Object getSofa() {
  return cas.getSofa();
 }
}

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.stanfordnlp-gpl

String sofaMime = aSrcCasView.getSofa().getSofaMime();
if (aSrcCasView.getDocumentText() != null) {
  targetView.setSofaDataString(aSrcCasView.getDocumentText(), sofaMime);
          .getFeatureValue(mDestSofaFeature);
      if (sofa == null) {
        copyOfFs.setFeatureValue(mDestSofaFeature, targetView.getSofa());

代码示例来源:origin: org.apache.uima/uimaj-tools

} else {
 if (getCas().getSofaDataArray() != null) {
  text = "Sofa array with mime type = " + getCas().getSofa().getSofaMime();

代码示例来源:origin: apache/uima-uimaj

/**
 * Return a label to identify the view.
 */
public String toString() {
 SofaFS sofaFS = cas.getSofa();
 if (null == sofaFS)
  return "No Sofa";
 return sofaFS.getSofaID();
}

代码示例来源:origin: org.apache.uima/uimaj-tools

@Override
 public void itemStateChanged(ItemEvent e) {
  // a new sofa was selected. Switch to that view and update
  // display
  String sofaId = (String) e.getItem();
  this.main.setCas(this.main.getCas().getView(sofaId));
  String text = this.main.getCas().getDocumentText();
  if (text == null) {
   text = this.main.getCas().getSofaDataURI();
   if (text != null) {
    text = "SofaURI = " + text;
   } else {
    if (null != this.main.getCas().getSofaDataArray()) {
     text = "Sofa array with mime type = " + this.main.getCas().getSofa().getSofaMime();
    }
   }
  }
  String oldText = this.main.getTextArea().getText();
  if ((oldText == null) || (text == null) || !oldText.equals(text)) {
   this.main.setText(text);
  }
  if (text == null) {
   this.main.getTextArea().repaint();
  }
  this.main.updateIndexTree(true);
 }
}

代码示例来源:origin: nlpie/biomedicus

/**
 * Constructor which takes the destination view. Initializes the {@code FsCopiers} and {@code
 * FsConstructors} fields using new objects. Initializes the queue using {@link ArrayDeque} and
 * the map using {@link HashMap}.
 *
 * @param destinationView the
 */
FeatureStructureCopyingQueue(CAS sourceView, CAS destinationView) {
 fsCopiers = new FsCopiers(this::enqueue);
 fsConstructors = new FsConstructors(destinationView);
 fsQueue = new ArrayDeque<>();
 fsMap = new HashMap<>();
 fsMap.put(sourceView.getSofa(), destinationView.getSofa());
}

代码示例来源:origin: org.apache.uima/uimaj-tools

public void process(CAS aCAS) throws AnalysisEngineProcessException {
 // get handle to CAS view containing XML document
 CAS xmlCas = aCAS.getView("xmlDocument");
 InputStream xmlStream = xmlCas.getSofa().getSofaDataStream();
 // parse with detag handler
 DetagHandler handler = new DetagHandler();
 try {
  SAXParser parser = parserFactory.newSAXParser();
  parser.parse(xmlStream, handler);
 } catch (Exception e) {
  throw new AnalysisEngineProcessException(e);
 }
 // create the plain text view and set its document text
 CAS plainTextView = aCAS.createView("plainTextDocument");
 plainTextView.setDocumentText(handler.getDetaggedText());
 plainTextView.setDocumentLanguage(aCAS.getView("_InitialView").getDocumentLanguage());
 // Index the SourceDocumentInformation object, if there is one, in the new sofa.
 // This is needed by the SemanticSearchCasIndexer
 Iterator iter = xmlCas.getAnnotationIndex(sourceDocInfoType).iterator();
 if (iter.hasNext()) {
  FeatureStructure sourceDocInfoFs = (FeatureStructure) iter.next();
  plainTextView.getIndexRepository().addFS(sourceDocInfoFs);
 }
}

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.castransformation-asl

FeatureStructure sofa = fsCopy.getFeatureValue(mDestSofaFeature);
if (sofa == null) {
  fsCopy.setFeatureValue(mDestSofaFeature, targetView.getSofa());

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.stanfordnlp-gpl

return getOrCreateView(mDestCas, sofaId).getSofa();

相关文章