Examples of FSArray


Examples of org.apache.uima.jcas.cas.FSArray

   *
   * @see org.apache.uima.jcas.JCas#getFSArray0L()
   */
  public FSArray getFSArray0L() {
    if (null == sharedView.fsArray0L)
      sharedView.fsArray0L = new FSArray(this, 0);
    return sharedView.fsArray0L;
  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.FSArray

   *
   * @see org.apache.uima.jcas.JCas#getFSArray0L()
   */
  public FSArray getFSArray0L() {
    if (null == sharedView.fsArray0L)
      sharedView.fsArray0L = new FSArray(this, 0);
    return sharedView.fsArray0L;
  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.FSArray

      Annotation crossAnnot = gerCrossAnnot.getOtherAnnotation();
      assertTrue((CAS.TYPE_NAME_ANNOTATION).equals(crossAnnot.getType().getName()));
      assertTrue(("this").equals(crossAnnot.getCoveredText()));

      // Test that annotations accessed from a reference in the base CAS work correctly
      FSArray anArray = new FSArray(jcas, 3);
      anArray.set(0, engAnnot);
      anArray.set(1, frAnnot);
      anArray.set(2, gerCrossAnnot);
      Annotation tstAnnot = (Annotation) anArray.get(0);
      assertTrue(("this").equals(tstAnnot.getCoveredText()));
      tstAnnot = (Annotation) anArray.get(1);
      assertTrue(("cette").equals(tstAnnot.getCoveredText()));
      tstAnnot = (Annotation) anArray.get(2);
      assertTrue(("das").equals(tstAnnot.getCoveredText()));
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.FSArray

      r1.setArrayFloat(1, (float) 2.5);
      assertTrue(3.0 == r1.getArrayFloat(0));
      assertTrue(2.5 == r1.getArrayFloat(1));

      Root r2 = new Root(jcas);
      r2.setArrayRef(new FSArray(jcas, 3));
      EndOfSentence eos1 = new EndOfSentence(jcas);
      EndOfSentence eos2 = new EndOfSentence(jcas);

      r2.setArrayRef(0, eos1);
      r2.setArrayRef(1, eos2);
View Full Code Here

Examples of org.apache.uima.jcas.cas.FSArray

    while (iterator.isValid()) {
      // Hier Schleife
      AnnotationFS fs = iterator.get();
      if (fs.getType().equals(blockApplyType)) {
        FeatureStructure featureValue = fs.getFeatureValue(innerApplyFeature);
        FSArray array = (FSArray) featureValue;

        // Schleife
        // AnnotationFS ruleApply = (AnnotationFS) array.get(0);
        for (int i = 0; i < array.size(); i++) {

          AnnotationFS ruleApply = (AnnotationFS) array.get(i);

          if (ruleApply.getType().equals(ruleApplyType)) {
            applyAmount += ruleApply.getIntValue(appliedFeature);

            triedAmount += ruleApply.getIntValue(triedFeature);
View Full Code Here

Examples of org.apache.uima.jcas.cas.FSArray

    FSIterator<AnnotationFS> iterator = cas.getAnnotationIndex(blockApplyType).iterator();
    if (iterator.isValid()) {
      AnnotationFS fs = iterator.get();
      if (fs.getType().equals(blockApplyType)) {
        FeatureStructure featureValue = fs.getFeatureValue(innerApplyFeature);
        FSArray array = (FSArray) featureValue;

        FeatureStructure[] fsArray = array.toArray();
        for (FeatureStructure featureStructure : fsArray) {
          AnnotationFS ruleApply = (AnnotationFS) featureStructure;
          if (ruleApply.getType().equals(ruleApplyType)) {
            applyAmount = ruleApply.getIntValue(appliedFeature);
            triedAmount = ruleApply.getIntValue(triedFeature);
View Full Code Here

Examples of org.apache.uima.jcas.cas.FSArray

    FSIterator<AnnotationFS> iterator = cas.getAnnotationIndex(blockApplyType).iterator();
    if (iterator.isValid()) {
      AnnotationFS fs = iterator.get();
      if (fs.getType().equals(blockApplyType)) {
        FeatureStructure featureValue = fs.getFeatureValue(innerApplyFeature);
        FSArray array = (FSArray) featureValue;
        AnnotationFS ruleApply = (AnnotationFS) array.get(0);

        if (ruleApply.getType().equals(ruleApplyType)) {
          applyAmount = ruleApply.getIntValue(appliedFeature);
          triedAmount = ruleApply.getIntValue(triedFeature);
        }
View Full Code Here

Examples of org.apache.uima.jcas.cas.FSArray

import org.apache.uima.jcas.cas.StringArray;

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

Examples of org.apache.uima.jcas.cas.FSArray

        ec.setElement(verbalizer.verbalize(each.getCondition()));
        ec.setConditions(createEvaluatedConditions(each, stream, addToIndex));
        ecs.add(ec);
      }
    }
    FSArray result = UIMAUtils.toFSArray(cas, ecs);
    return result;
  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.FSArray

      ec.setValue(each.isValue());
      ec.setElement(verbalizer.verbalize(each.getCondition()));
      ec.setConditions(createEvaluatedConditions(each, stream, addToIndex));
      ecs.add(ec);
    }
    FSArray result = UIMAUtils.toFSArray(cas, ecs);
    return result;
  }
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.