org.apache.uima.jcas.cas.FSArray.copyFromArray()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(69)

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

FSArray.copyFromArray介绍

[英]Not supported, will throw UnsupportedOperationException
[中]不支持,将抛出UnsupportedOperationException

代码示例

代码示例来源:origin: org.apache.uima/ruta-core

public static FSArray toFSArray(JCas jCas, List<? extends FeatureStructure> fsList) {
 FSArray fsArray = new FSArray(jCas, fsList.size());
 fsArray.copyFromArray(fsList.toArray(new FeatureStructure[fsList.size()]), 0, 0, fsList.size());
 return fsArray;
}

代码示例来源:origin: org.apache.uima/textmarker-core

public static FSArray toFSArray(JCas jCas, List<? extends FeatureStructure> fsList) {
 FSArray fsArray = new FSArray(jCas, fsList.size());
 fsArray.copyFromArray(fsList.toArray(new FeatureStructure[fsList.size()]), 0, 0, fsList.size());
 return fsArray;
}

代码示例来源:origin: ClearTK/cleartk

public static void initTerminalNodes(
  org.cleartk.syntax.constituent.type.TopTreebankNode uimaNode,
  JCas jCas) {
 List<TerminalTreebankNode> terminals = new ArrayList<org.cleartk.syntax.constituent.type.TerminalTreebankNode>();
 _initTerminalNodes(uimaNode, terminals);
 for (int i = 0; i < terminals.size(); i++) {
  TerminalTreebankNode terminal = terminals.get(i);
  terminal.setIndex(i);
 }
 FSArray terminalsFSArray = new FSArray(jCas, terminals.size());
 terminalsFSArray.copyFromArray(
   terminals.toArray(new FeatureStructure[terminals.size()]),
   0,
   0,
   terminals.size());
 uimaNode.setTerminals(terminalsFSArray);
}

代码示例来源:origin: hltfbk/Excitement-Open-Platform

public static ClauseTruth mapClauseTruth(eu.excitementproject.eop.transformations.representation.annotations.ClauseTruth ct, JCas jcas, List<Token> subtree,int begin,int end){
  int subtreeSize = subtree.size();
  Type type = jcas.getTypeSystem().getType(CLAUSE_TRUTH_MAP.get(ct).getName());
  ClauseTruth ret = (ClauseTruth)jcas.getCas().createAnnotation(type, begin, end);

  // set the subtree tokens as a feature structure		
  FSArray subtreeFSArray = new FSArray(jcas, subtreeSize);
  subtreeFSArray.copyFromArray(subtree.toArray(new Token[subtree.size()]), 0, 0, subtreeSize);
  ret.setClauseTokens(subtreeFSArray);
  return ret;
}

代码示例来源:origin: org.cleartk/cleartk-corpus

public static void initTerminalNodes(
  org.cleartk.syntax.constituent.type.TopTreebankNode uimaNode,
  JCas jCas) {
 List<TerminalTreebankNode> terminals = new ArrayList<org.cleartk.syntax.constituent.type.TerminalTreebankNode>();
 _initTerminalNodes(uimaNode, terminals);
 for (int i = 0; i < terminals.size(); i++) {
  TerminalTreebankNode terminal = terminals.get(i);
  terminal.setIndex(i);
 }
 FSArray terminalsFSArray = new FSArray(jCas, terminals.size());
 terminalsFSArray.copyFromArray(
   terminals.toArray(new FeatureStructure[terminals.size()]),
   0,
   0,
   terminals.size());
 uimaNode.setTerminals(terminalsFSArray);
}

代码示例来源:origin: org.apache.uima/ConceptMapper

FeatureStructure[] featureStructArray = new FeatureStructure[matched.size()];
matched.toArray(featureStructArray);
matchedTokens.copyFromArray(featureStructArray, 0, 0, featureStructArray.length);
annotation.setFeatureValue(matchedTokensFeature, matchedTokens);

代码示例来源:origin: ClearTK/cleartk

/**
 * Create a branch TreebankNode in a JCas. The offsets of this node will be determined by its
 * children.
 * 
 * @param jCas
 *          The JCas which the annotation should be added to.
 * @param nodeType
 *          The phrase type tag of the node.
 * @param children
 *          The TreebankNode children of the node.
 * @return The TreebankNode which was added to the JCas.
 */
public static TreebankNode newNode(JCas jCas, String nodeType, TreebankNode... children) {
 int begin = children[0].getBegin();
 int end = children[children.length - 1].getEnd();
 TreebankNode node = new TreebankNode(jCas, begin, end);
 node.setNodeType(nodeType);
 node.addToIndexes();
 FSArray fsArray = new FSArray(jCas, children.length);
 fsArray.copyFromArray(children, 0, 0, children.length);
 node.setChildren(fsArray);
 for (TreebankNode child : children) {
  child.setParent(node);
 }
 return node;
}

代码示例来源:origin: org.cleartk/cleartk-corpus

uimaChildrenFSArray.copyFromArray(
  uimaChildren.toArray(new FeatureStructure[uimaChildren.size()]),
  0,

代码示例来源:origin: ClearTK/cleartk

uimaChildrenFSArray.copyFromArray(
  uimaChildren.toArray(new FeatureStructure[uimaChildren.size()]),
  0,

相关文章