Package org.apache.ctakes.dependency.parser.util

Examples of org.apache.ctakes.dependency.parser.util.DependencyPath


     
      if ( isDonorTerm(tok) ) {
        vfeat.put(DONOR_TOKEN, true);
       
        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(DONOR_DEPTOK, true);
        }
      }
      if ( isFamilyTerm(tok) ) {
        vfeat.put(FAMILY_TOKEN, true);

        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
       
        // 6/28/13 srh fixing for null pointer exception
        if (path != null) {
          int commonInd = path.indexOf(path.getCommonNode());
          if (commonInd==1 || commonInd==path.size()-2) {
            vfeat.put(FAMILY_DEPTOK, true);
          }
        }
      }
     
      if ( isOtherTerm(tok) ) {
        vfeat.put(OTHER_TOKEN, true);

        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(OTHER_DEPTOK, true);
        }
      }
    }
    return vfeat;
View Full Code Here


   
    // Iterate through all nodes in the sentence to find the focus node
    for (int i=0; i<nodes.size(); i++) {
      ConllDependencyNode hypNegNode = nodes.get(i);
//      System.out.println("Node "+i+": {"+hypNegNode.getFORM()+"}"+hypNegNode.getPOSTAG()+">"+hypNegNode.getDEPREL());
      DependencyPath path = DependencyUtility.getPath(nodes, hypNegNode, focus);
      if(path == null) continue;
      int featMatchInd = findPathMatches(path);
      if ( featMatchInd != -1) {
//        hits.add(hypNegNode);
        feats[featMatchInd] = true;
View Full Code Here

     
      if ( isDonorTerm(tok) ) {
        vfeat.put(DONOR_TOKEN, true);
       
        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(DONOR_DEPTOK, true);
        }
      }
      if ( isFamilyTerm(tok) ) {
        vfeat.put(FAMILY_TOKEN, true);

        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
       
        // 6/28/13 srh fixing for null pointer exception
        if (path != null) {
          int commonInd = path.indexOf(path.getCommonNode());
          if (commonInd==1 || commonInd==path.size()-2) {
            vfeat.put(FAMILY_DEPTOK, true);
          }
        }
      }
     
      if ( isOtherTerm(tok) ) {
        vfeat.put(OTHER_TOKEN, true);

        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(OTHER_DEPTOK, true);
        }
      }
    }
    return vfeat;
View Full Code Here

   
    // Iterate through all nodes in the sentence to find the focus node
    for (int i=0; i<nodes.size(); i++) {
      ConllDependencyNode hypNegNode = nodes.get(i);
//      System.out.println("Node "+i+": {"+hypNegNode.getFORM()+"}"+hypNegNode.getPOSTAG()+">"+hypNegNode.getDEPREL());
      DependencyPath path = DependencyUtility.getPath(nodes, hypNegNode, focus);
      if(path == null) continue;
      int featMatchInd = findPathMatches(path);
      if ( featMatchInd != -1) {
//        hits.add(hypNegNode);
        feats[featMatchInd] = true;
View Full Code Here

     
      if ( isDonorTerm(tok) ) {
        vfeat.put(DONOR_TOKEN, true);
       
        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(DONOR_DEPTOK, true);
        }
      }
      if ( isFamilyTerm(tok) ) {
        vfeat.put(FAMILY_TOKEN, true);

        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
       
        // 6/28/13 srh fixing for null pointer exception
        if (path != null) {
          int commonInd = path.indexOf(path.getCommonNode());
          if (commonInd==1 || commonInd==path.size()-2) {
            vfeat.put(FAMILY_DEPTOK, true);
          }
        }
      }
     
      if ( isOtherTerm(tok) ) {
        vfeat.put(OTHER_TOKEN, true);

        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(OTHER_DEPTOK, true);
        }
      }
    }
    return vfeat;
View Full Code Here

     
      if ( isDonorTerm(tok) ) {
        vfeat.put(DONOR_TOKEN, true);
       
        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(DONOR_DEPTOK, true);
        }
      }
      if ( isFamilyTerm(tok) ) {
        vfeat.put(FAMILY_TOKEN, true);

        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(FAMILY_DEPTOK, true);
        }
      }
     
      if ( isOtherTerm(tok) ) {
        vfeat.put(OTHER_TOKEN, true);

        // check if there are one-removed dependencies on the dependency path
        DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok),
            DependencyUtility.getNominalHeadNode(jCas,mention));
        int commonInd = path.indexOf(path.getCommonNode());
        if (commonInd==1 || commonInd==path.size()-2) {
          vfeat.put(OTHER_DEPTOK, true);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.ctakes.dependency.parser.util.DependencyPath

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.