Package org.apache.uima.jcas.cas

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


    }
  }

  private void processAttributes(AnnotationFS annotation, Tag tag) {
    int size = tag.getAttributesEx().size() - 1;
    StringArray attributeName = new StringArray(jcas, size);
    StringArray attributeValue = new StringArray(jcas, size);
    for (int i = 0; i < size; i++) {
      Attribute attribute = (Attribute) tag.getAttributesEx().elementAt(i + 1);
      attributeName.set(i, attribute.getName());
      attributeValue.set(i, attribute.getValue());
    }
    Feature feature1 = annotation.getType().getFeatureByBaseName("attributeName");
    annotation.setFeatureValue(feature1, attributeName);
    Feature feature2 = annotation.getType().getFeatureByBaseName("attributeValue");
    annotation.setFeatureValue(feature2, attributeValue);
View Full Code Here


      r2.setArrayInt(0, 17);
      assertTrue(r2.getArrayInt(0) == 17);
      IntegerArray ia = r2.getArrayInt();
      assertTrue(ia.get(0) == 17);

      r2.setArrayString(new StringArray(jcas, 2));
      r2.setArrayString(0, "zero");
      r2.setArrayString(1, "one");
      assertTrue(r2.getArrayString(0).equals("zero"));
      assertTrue(r2.getArrayString(1).equals("one"));
View Full Code Here

          if (value == null) {
            return false;
          }

          if (value instanceof StringArray) {
            StringArray array = (StringArray) featureValue.getValue();

            if (array.size() > 0) {
              return true;
            } else {
              return false;
            }
          }
View Full Code Here

   * @see org.apache.uima.jcas.JCas#getStringArray0L()
   */

  public StringArray getStringArray0L() {
    if (null == sharedView.stringArray0L)
      sharedView.stringArray0L = new StringArray(this, 0);
    return sharedView.stringArray0L;
  }
View Full Code Here

  public static StringArrayFS createStringArray(CAS aCas, String[] aArray) {
    return fillArrayFS(aCas.createStringArrayFS(aArray.length), aArray);
  }

  public static StringArrayFS createStringArray(JCas aJCas, Collection<String> aCollection) {
    return fillArrayFS(new StringArray(aJCas, aCollection.size()), aCollection);
  }
View Full Code Here

  public static StringArrayFS createStringArray(JCas aJCas, Collection<String> aCollection) {
    return fillArrayFS(new StringArray(aJCas, aCollection.size()), aCollection);
  }

  public static StringArrayFS createStringArray(JCas aJCas, String[] aArray) {
    return fillArrayFS(new StringArray(aJCas, aArray.length), aArray);
  }
View Full Code Here

  }

  public String calcNPSubj(TreebankNode n){
    if(n == null) return "N";
    if(n.getNodeType().equals("NP")){
      StringArray tags = n.getNodeTags();
      if(tags.size() > 0){
        for(int i = 0; i < tags.size(); i++){
          if(tags.get(i).equals("SBJ")){
            return "Y";
          }
        }
      }
    }
View Full Code Here

    a.set(2, (short)2);
    f.setF1Shorts(a);
    f.addToIndexes();
   
    OfStrings ss = new OfStrings(jcas);
    StringArray sa = new StringArray(jcas, 3);
    sa.set(0, "0s");
    sa.set(1, "1s");
    sa.set(2, "2s");
    ss.setF1Strings(sa);
    ss.addToIndexes();
   
    CasToInlineXml c2x = new CasToInlineXml();
    String result = c2x.generateXML(srcCas);
View Full Code Here

      r2.setArrayInt(0, 17);
      assertTrue(r2.getArrayInt(0) == 17);
      IntegerArray ia = r2.getArrayInt();
      assertTrue(ia.get(0) == 17);

      r2.setArrayString(new StringArray(jcas, 2));
      r2.setArrayString(0, "zero");
      r2.setArrayString(1, "one");
      assertTrue(r2.getArrayString(0).equals("zero"));
      assertTrue(r2.getArrayString(1).equals("one"));
View Full Code Here

          if (value == null) {
            return false;
          }

          if (value instanceof StringArray) {
            StringArray array = (StringArray) featureValue.getValue();

            if (array.size() > 0) {
              return true;
            } else {
              return false;
            }
          }
View Full Code Here

TOP

Related Classes of org.apache.uima.jcas.cas.StringArray

Copyright © 2018 www.massapicom. 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.