Examples of TopTreebankNode


Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

  // the ctakes syntax typesystem was modeled after cleartk -- as a result, the following methods borrow very liberally from
  // org.cleartk.syntax.constituent.util.TreebankNodeUtility, which has a convert method for going from
  // a "normal" tree to a cleartk/uima tree.  This does the same, except goes to a ctakes/uima tree.
  private static TopTreebankNode convert(org.cleartk.syntax.constituent.util.TopTreebankNode inTree, JCas jcas){
    TopTreebankNode outTree = new TopTreebankNode(jcas, inTree.getTextBegin(), inTree.getTextEnd());
    outTree.setTreebankParse(inTree.getTreebankParse());
      convert(inTree, jcas, outTree, null);
      initTerminalNodes(outTree, jcas);


    outTree.addToIndexes();
    return outTree;
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

  public static final SimpleTree NULL_TREE = SimpleTree.fromString("(S (TOK nullparse))");
 
  public static SimpleTree extractFeatureTree(JCas jcas, Annotation mention, SemanticClasses sems){
    SimpleTree tree = null;
    TopTreebankNode annotationTree = AnnotationTreeUtils.getAnnotationTree(jcas, mention);
    if(annotationTree != null){
      TopTreebankNode root = AnnotationTreeUtils.getTreeCopy(jcas, annotationTree);
      AnnotationTreeUtils.insertAnnotationNode(jcas, root, mention, "CONCEPT");
      tree = TreeExtractor.getSimpleClone(root);
    }else{
      tree = NULL_TREE;
    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

    return tree;   
  }
 
  public static SimpleTree extractAboveLeftConceptTree(JCas jcas, Annotation mention, SemanticClasses sems){
    SimpleTree tree = null;
    TopTreebankNode annotationTree = AnnotationTreeUtils.getAnnotationTree(jcas, mention);
    if(annotationTree != null){
      TopTreebankNode root = AnnotationTreeUtils.getTreeCopy(jcas, annotationTree);
      TreebankNode conceptNode = AnnotationTreeUtils.insertAnnotationNode(jcas, root, mention, "CONCEPT");
      // navigate up the tree to retrieve the first "S" above this node.
      TreebankNode node = conceptNode;
      while(node.getParent() != null && !node.getNodeType().startsWith("S")){
        node =  node.getParent();
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

    }
  }

  public static SimpleTree extractAboveRightConceptTree(JCas jcas, Annotation mention, SemanticClasses sems){
    SimpleTree tree = null;
    TopTreebankNode annotationTree = AnnotationTreeUtils.getAnnotationTree(jcas, mention);
    if(annotationTree != null){
      TopTreebankNode root = AnnotationTreeUtils.getTreeCopy(jcas, annotationTree);
      TreebankNode conceptNode = AnnotationTreeUtils.insertAnnotationNode(jcas, root, mention, "CONCEPT");
      //            SimpleTree tree = null;
      //            tree = TreeExtractor.getSurroundingTreeWithAnnotation(node, "CONCEPT");
      // navigate up the tree to retrieve the first "S" above this node.
      TreebankNode node = conceptNode;
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

      if(sentStr.length() == 0){
        parse = null;
      }else{
        parse = parser.parse(inputTokens);
      }
      TopTreebankNode top = TreeUtils.buildAlignedTree(jcas, parse, sentAnnot);
      top.addToIndexes();
    }
    logger.info("Done parsing: " + docId);
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

public class AssertionTreeUtils {

  public static SimpleTree extractAboveLeftConceptTree(JCas jcas, Annotation mention, SemanticClasses sems){
    SimpleTree tree = null;
    TopTreebankNode annotationTree = AnnotationTreeUtils.getAnnotationTree(jcas, mention);
    if(annotationTree != null){
      TopTreebankNode root = AnnotationTreeUtils.getTreeCopy(jcas, annotationTree);
      TreebankNode conceptNode = AnnotationTreeUtils.insertAnnotationNode(jcas, root, mention, "CONCEPT");
      // navigate up the tree to retrieve the first "S" above this node.
      TreebankNode node = conceptNode;
      while(node.getParent() != null && !node.getNodeType().startsWith("S")){
        node =  node.getParent();
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

    }
  }

  public static SimpleTree extractAboveRightConceptTree(JCas jcas, Annotation mention, SemanticClasses sems){
    SimpleTree tree = null;
    TopTreebankNode annotationTree = AnnotationTreeUtils.getAnnotationTree(jcas, mention);
    if(annotationTree != null){
      TopTreebankNode root = AnnotationTreeUtils.getTreeCopy(jcas, annotationTree);
      TreebankNode conceptNode = AnnotationTreeUtils.insertAnnotationNode(jcas, root, mention, "CONCEPT");
      //            SimpleTree tree = null;
      //            tree = TreeExtractor.getSurroundingTreeWithAnnotation(node, "CONCEPT");
      // navigate up the tree to retrieve the first "S" above this node.
      TreebankNode node = conceptNode;
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

      if(sentStr.length() == 0){
        parse = null;
      }else{
        parse = parser.parse(inputTokens);
      }
      TopTreebankNode top = TreeUtils.buildAlignedTree(jcas, parse, sentAnnot);
      top.addToIndexes();
    }
//    logger.info("Done parsing: " + docId);
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

public class AssertionTreeUtils {

  public static SimpleTree extractAboveLeftConceptTree(JCas jcas, Annotation mention, SemanticClasses sems){
    SimpleTree tree = null;
    TopTreebankNode annotationTree = AnnotationTreeUtils.getAnnotationTree(jcas, mention);
    if(annotationTree != null){
      TopTreebankNode root = AnnotationTreeUtils.getTreeCopy(jcas, annotationTree);
      TreebankNode conceptNode = AnnotationTreeUtils.insertAnnotationNode(jcas, root, mention, "CONCEPT");
      // navigate up the tree to retrieve the first "S" above this node.
      TreebankNode node = conceptNode;
      while(node.getParent() != null && !node.getNodeType().startsWith("S")){
        node =  node.getParent();
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.TopTreebankNode

    return tree;
  }
 
  public static SimpleTree extractAboveRightConceptTree(JCas jcas, Annotation mention, SemanticClasses sems){
    SimpleTree tree = null;
    TopTreebankNode annotationTree = AnnotationTreeUtils.getAnnotationTree(jcas, mention);
    if(annotationTree != null){
      TopTreebankNode root = AnnotationTreeUtils.getTreeCopy(jcas, annotationTree);
      TreebankNode conceptNode = AnnotationTreeUtils.insertAnnotationNode(jcas, root, mention, "CONCEPT");
      //            SimpleTree tree = null;
      //            tree = TreeExtractor.getSurroundingTreeWithAnnotation(node, "CONCEPT");
      // navigate up the tree to retrieve the first "S" above this node.
      TreebankNode node = conceptNode;
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.