Examples of copyFromArray()


Examples of org.apache.uima.cas.ArrayFS.copyFromArray()

    if (probabilityFeature != null) {
      parseAnnotation.setDoubleValue(probabilityFeature, parse.getProb());
    }
   
    ArrayFS childrenArray = cas.createArrayFS(parseChildAnnotations.length);
    childrenArray.copyFromArray(parseChildAnnotations, 0, 0, parseChildAnnotations.length);
    parseAnnotation.setFeatureValue(childrenFeature, childrenArray);
   
    cas.getIndexRepository().addFS(parseAnnotation);
   
    return parseAnnotation;
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS.copyFromArray()

    if (probabilityFeature != null) {
      parseAnnotation.setDoubleValue(probabilityFeature, parse.getProb());
    }

    ArrayFS childrenArray = cas.createArrayFS(parseChildAnnotations.length);
    childrenArray.copyFromArray(parseChildAnnotations, 0, 0, parseChildAnnotations.length);
    parseAnnotation.setFeatureValue(childrenFeature, childrenArray);

    cas.getIndexRepository().addFS(parseAnnotation);

    return parseAnnotation;
View Full Code Here

Examples of org.apache.uima.cas.StringArrayFS.copyFromArray()

        + CASTestSetup.LEMMA_LIST_FEAT;
    final Feature lemmaList = this.ts.getFeatureByFullName(lemmaListName);
    assertTrue(lemmaList != null);
    String[] javaArray = { "1", "2", "3" };
    StringArrayFS casArray = this.cas.createStringArrayFS(3);
    casArray.copyFromArray(javaArray, 0, 0, 3);
    FeatureStructure token = this.cas.createFS(this.ts.getType(CASTestSetup.TOKEN_TYPE));
    assertTrue(token.getFeatureValue(lemmaList) == null);
    token.setFeatureValue(lemmaList, casArray);
    assertTrue(((StringArrayFS) token.getFeatureValue(lemmaList)).get(0) == "1");
    String hello = "Hello.";
View Full Code Here

Examples of org.apache.uima.cas.StringArrayFS.copyFromArray()

  + CASTestSetup.LEMMA_LIST_FEAT;
    final Feature lemmaList = this.ts.getFeatureByFullName(lemmaListName);
    assertTrue(lemmaList != null);
    String[] javaArray = { "1", "2", "3" };
    StringArrayFS casArray = this.cas.createStringArrayFS(3);
    casArray.copyFromArray(javaArray, 0, 0, 3);
    FeatureStructure token = this.cas.createFS(this.ts.getType(CASTestSetup.TOKEN_TYPE));
    assertTrue(token.getFeatureValue(lemmaList) == null);
    token.setFeatureValue(lemmaList, casArray);
    assertTrue(((StringArrayFS) token.getFeatureValue(lemmaList)).get(0) == "1");
    String hello = "Hello.";
View Full Code Here

Examples of org.apache.uima.cas.StringArrayFS.copyFromArray()

  + CASTestSetup.LEMMA_LIST_FEAT;
    final Feature lemmaList = this.ts.getFeatureByFullName(lemmaListName);
    assertTrue(lemmaList != null);
    String[] javaArray = { "1", "2", "3" };
    StringArrayFS casArray = this.cas.createStringArrayFS(3);
    casArray.copyFromArray(javaArray, 0, 0, 3);
    FeatureStructure token = this.cas.createFS(this.ts.getType(CASTestSetup.TOKEN_TYPE));
    assertTrue(token.getFeatureValue(lemmaList) == null);
    token.setFeatureValue(lemmaList, casArray);
    assertTrue(((StringArrayFS) token.getFeatureValue(lemmaList)).get(0) == "1");
    String hello = "Hello.";
View Full Code Here

Examples of org.apache.uima.cas.StringArrayFS.copyFromArray()

  + CASTestSetup.LEMMA_LIST_FEAT;
    final Feature lemmaList = this.ts.getFeatureByFullName(lemmaListName);
    assertTrue(lemmaList != null);
    String[] javaArray = { "1", "2", "3" };
    StringArrayFS casArray = this.cas.createStringArrayFS(3);
    casArray.copyFromArray(javaArray, 0, 0, 3);
    FeatureStructure token = this.cas.createFS(this.ts.getType(CASTestSetup.TOKEN_TYPE));
    assertTrue(token.getFeatureValue(lemmaList) == null);
    token.setFeatureValue(lemmaList, casArray);
    assertTrue(((StringArrayFS) token.getFeatureValue(lemmaList)).get(0) == "1");
    String hello = "Hello.";
View Full Code Here

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

    return uimaSArray;
  }

  public static DoubleArray toDoubleArray(JCas jCas, double[] sArray) {
    DoubleArray uimaSArray = new DoubleArray(jCas, sArray.length);
    uimaSArray.copyFromArray(sArray, 0, 0, sArray.length);
    return uimaSArray;
  }

  public static IntegerArray toIntegerArray(JCas jCas, int[] sArray) {
    IntegerArray uimaSArray = new IntegerArray(jCas, sArray.length);
View Full Code Here

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

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

    }
    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

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

      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
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.