Package org.apache.uima.jcas.cas

Examples of org.apache.uima.jcas.cas.FSArray.copyFromArray()


public class UIMAUtils {

  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;
  }

  public static StringArray toStringArray(JCas jCas, String[] sArray) {
    StringArray uimaSArray = new StringArray(jCas, sArray.length);
View Full Code Here


    }
    FSArray sTypeArray = new FSArray(jCas, semTypeArray.size());
    FeatureStructure[] semTypeFtrStructArray = new FeatureStructure[semTypeArray
        .size()];
    semTypeArray.toArray(semTypeFtrStructArray);
    sTypeArray.copyFromArray(semTypeFtrStructArray, 0, 0,
        semTypeFtrStructArray.length);
    tgtConcept.setTuis(sTypeArray);
  }

  private void populateSynonyms(JCas jCas, Concept c,
View Full Code Here

      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);
View Full Code Here

      }
      uimaChildren.add(convert(child, jCas, childNode, uimaNode));
      childNode.addToIndexes();
    }
    FSArray uimaChildrenFSArray = new FSArray(jCas, uimaChildren.size());
    uimaChildrenFSArray.copyFromArray(
        uimaChildren.toArray(new FeatureStructure[uimaChildren.size()]),
        0,
        0,
        uimaChildren.size());
    uimaNode.setChildren(uimaChildrenFSArray);
View Full Code Here

    }
    FSArray sTypeArray = new FSArray(jCas, semTypeArray.size());
    FeatureStructure[] semTypeFtrStructArray = new FeatureStructure[semTypeArray
        .size()];
    semTypeArray.toArray(semTypeFtrStructArray);
    sTypeArray.copyFromArray(semTypeFtrStructArray, 0, 0,
        semTypeFtrStructArray.length);
    tgtConcept.setTuis(sTypeArray);
  }

  private void populateSynonyms(JCas jCas, Concept c,
View Full Code Here

    if (matchedTokensFeature != null) {
      FSArray matchedTokens = new FSArray(getJCas(), matched.size());
      FeatureStructure[] featureStructArray = new FeatureStructure[matched.size()];
      matched.toArray(featureStructArray);
      matchedTokens.copyFromArray(featureStructArray, 0, 0, featureStructArray.length);
      annotation.setFeatureValue(matchedTokensFeature, matchedTokens);
      /*
       * FSArray tmp = (FSArray) annotation.getFeatureValue (matchedTokensFeature); FeatureStructure []
       * tmpfs = tmp.toArray (); System.err.println ("FSArray: begin"); for (int i = 0; i <
       * tmpfs.length; i++) { System.err.println (((Annotation) tmpfs[i]).getCoveredText ()); }
View Full Code Here

    if (matchedTokensFeature != null) {
      FSArray matchedTokens = new FSArray(getJCas(), matched.size());
      FeatureStructure[] featureStructArray = new FeatureStructure[matched.size()];
      matched.toArray(featureStructArray);
      matchedTokens.copyFromArray(featureStructArray, 0, 0, featureStructArray.length);
      annotation.setFeatureValue(matchedTokensFeature, matchedTokens);
      /*
       * FSArray tmp = (FSArray) annotation.getFeatureValue (matchedTokensFeature); FeatureStructure []
       * tmpfs = tmp.toArray (); System.err.println ("FSArray: begin"); for (int i = 0; i <
       * tmpfs.length; i++) { System.err.println (((Annotation) tmpfs[i]).getCoveredText ()); }
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.