Examples of FSArray


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

  @Override
  protected String extractInformation(IdentifiedAnnotation t) {
    StringBuilder buff = new StringBuilder();
   
    FSArray mentions = t.getOntologyConceptArr();
   
    HashSet<String> uniqueCuis = new HashSet<String>();
    if(mentions == null) return null;
    for(int i = 0; i < mentions.size(); i++){
      if(mentions.get(i) instanceof UmlsConcept){
        UmlsConcept concept = (UmlsConcept) mentions.get(i);
        uniqueCuis.add(concept.getCui());
      }
    }
   
    for(String cui : uniqueCuis){
View Full Code Here

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

        }
      }else{
        props.setContextualModality(modality);
      }
      e.setProperties(props);
      FSArray mentions = new FSArray(jcas,1);
      mentions.set(0, event);
      e.setMentions(mentions);
      event.setEvent(e);
      e.addToIndexes();
      event.addToIndexes();
      props.addToIndexes();
View Full Code Here

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

        }
        replacementNode.setParent(tree);
       
        tree.setNodeType("CONCEPT");
//        tree.children = new ArrayList<SimpleTree>();
        FSArray children = new FSArray(jcas, 1);
        children.set(0, replacementNode);
        tree.setChildren(children);
//        tree.addChild(replacementNode);
      }
    }
  }
View Full Code Here

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

    while(iterator.hasNext()){
      Sentence sentAnnot = (Sentence) iterator.next();
      if(sentAnnot.getCoveredText().length() == 0){
        continue;
      }
      FSArray termArray = TreeUtils.getTerminals(jcas, sentAnnot);
      Parse inputTokens = TreeUtils.ctakesTokensToOpennlpTokens(sentAnnot, termArray);
      String sentStr = TreeUtils.getSentence(termArray);
      if(sentStr.length() == 0){
        parse = null;
      }else{
View Full Code Here

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

          eventProperties.setPermanence(permanence);
          eventProperties.addToIndexes();
          event.setConfidence(1.0f);
          event.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);
          event.setProperties(eventProperties);
          event.setMentions(new FSArray(jCas, 1));
          event.setMentions(0, eventMention);
          event.addToIndexes();
          eventMention.setConfidence(1.0f);
          eventMention.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);
          eventMention.setEvent(event);
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

      tgtSemType.setEnd(tgtConcept.getEnd());
      tgtSemType.setTui(sType.getCode());
      tgtSemType.setSty(sType.getName());
      semTypeArray.add(tgtSemType);
    }
    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);
  }
View Full Code Here

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

      Feature feature = currentType.getFeatureByBaseName(pathEntry);
      childs.clear();

      if (feature.getRange().isArray()) {
        for (FeatureStructure featureStructureItem : featureStructures) {
          FSArray fsArray = (FSArray) featureStructureItem.getFeatureValue(feature);
          if (fsArray == null)
            continue;

          for (int i = 0; i < fsArray.size(); i++)
            childs.add(fsArray.get(i));
        }
      } else
        for (FeatureStructure featureStructureItem : featureStructures)
          childs.add(featureStructureItem.getFeatureValue(feature));
View Full Code Here

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

    if (resultMatchedTextFeature != null) {
      annotation.setStringValue(resultMatchedTextFeature, matchedText);
    }

    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

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

      MarkupAnnotation markup = new MarkupAnnotation(jcas);
      markup.setBegin(proto.getStart());
      markup.setEnd(proto.getEnd());
      // generate attributes
      Attributes protoAttributes = proto.getAtts();
      FSArray attribs = (FSArray) cas.createArrayFS(protoAttributes.getLength());
      for (int index=0; index< protoAttributes.getLength();index++){
        org.apache.uima.tika.AttributeFS afs = (AttributeFS) cas.createFS(attributeType);
        afs.setLocalName(protoAttributes.getLocalName(index));
        afs.setQualifiedName(protoAttributes.getQName(index));
        afs.setUri(protoAttributes.getURI(index));
        afs.setValue(protoAttributes.getValue(index));
        afs.addToIndexes();
        attribs.set(index, afs);
      }
      markup.setAttributes(attribs);
      markup.setUri(proto.getUri());
      markup.setName(proto.getLocalName());
      markup.setQualifiedName(proto.getQName());
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.