Package com.clearnlp.dependency.srl

Examples of com.clearnlp.dependency.srl.SRLArc


    s_heads.add(arc);
  }
 
  public void addSHead(DEPNode head, String label)
  {
    s_heads.add(new SRLArc(head, label));
  }
View Full Code Here


    s_heads.add(new SRLArc(head, label));
  }
 
  public void addSHead(DEPNode head, String label, String functionTag)
  {
    s_heads.add(new SRLArc(head, label, functionTag));
  }
View Full Code Here

 
  void extractVerbPPAux(DEPTree tree, Prob2DMap map)
  {
    int i, size = tree.size();
    DEPNode verb;
    SRLArc arc;
   
    tree.setDependents();
   
    for (i=1; i<size; i++)
    {
      verb = tree.get(i);
     
      if (MPLibEn.isVerb(verb.pos))
      {
        for (DEPNode arg : verb.getDependentNodeList())
        {
          if (!arg.isLabel(DEPLibEn.DEP_AGENT) && (arc = arg.getSHead(verb)) != null)
          {
            if (arg.isPos(CTLibEn.POS_IN) && PBLib.isCoreNumberedArgument(arc.getLabel()))
              map.add(verb.lemma, arg.lemma);
          }
        }
      }
    }
View Full Code Here

  private StringIntPair[][] getSHeadsAux()
  {
    int i, j, len, size = size();
    StringIntPair[] heads;
    List<SRLArc> arcs;
    SRLArc arc;
   
    StringIntPair[][] sHeads = new StringIntPair[size][];
    sHeads[0] = new StringIntPair[0];
   
    for (i=1; i<size; i++)
    {
      arcs  = get(i).getSHeads();
      len   = arcs.size();
      heads = new StringIntPair[len];
     
      for (j=0; j<len; j++)
      {
        arc = arcs.get(j);
        heads[j] = new StringIntPair(arc.label, arc.getNode().id);
      }
     
      sHeads[i] = heads;
    }
   
View Full Code Here

      head = head.getHead();
   
    if (MPLibEn.isNoun(head.pos) || head.isPos(CTLibEn.POS_IN) || head.isPos(CTLibEn.POS_RP))
    {
      DEPNode gHead = head.getHead();
      SRLArc  sp, sh;
     
      if (gHead != null && (sp = prep.getSHead(gHead)) != null)
      {
        if ((sh = head.getSHead(gHead)) != null)
        {
          if (head.isPos(CTLibEn.POS_IN) && sh.isLabel(SRLLib.C_V))
          {
            head.pos = CTLibEn.POS_RP;
            head.setLabel(DEP_PRT);
          }
         
          prep.setHead(gHead);
        }
        else
        {
          prep.removeSHead(sp);
          head.addSHead(gHead, sp.getLabel());
        }
      }
     
//      if (gHead != null && (sp = prep.getSHead(gHead)) != null && (sh = head.getSHead(gHead)) != null)
//        prep.setHead(gHead);
View Full Code Here

  }
 
  /** Called by {@link DEPLibEn#relinkReferent(DEPNode)}. */
  static private Pair<DEPNode,SRLArc> getFirstRelativizer(DEPNode verb)
  {
    SRLArc  sHead;
    DEPNode dep;
   
    for (DEPArc arc : verb.getDependents())
    {
      dep = arc.getNode();
View Full Code Here

  static private Pair<DEPNode,SRLArc> getLastPrepositionWithoutDependent(DEPNode verb)
  {
    List<DEPArc> arcs = verb.getDependents();
    DEPNode dep;
    DEPArc arc;
    SRLArc sHead;
    int i;
   
    for (i=arcs.size()-1; i>=0; i--)
    {
      arc = arcs.get(i);
View Full Code Here

 
  /** Called by {@link DEPLibEn#postLabel(DEPTree)}. */
  static private void relabelPrepositionWithReferent(DEPNode verb)
  {
    DEPNode dep, pobj;
    SRLArc sHead;
   
    for (DEPArc arc : verb.getDependents())
    {
      dep = arc.getNode();
     
      if (dep.isPos(CTLibEn.POS_IN) && (sHead = dep.getSHead(verb)) != null && !sHead.isLabel(SRLLib.P_ARG_REF))
      {
        pobj = dep.getFirstDependentByLabel(DEPLibEn.DEP_POBJ);
       
        if (pobj != null && getRefDependentNode(pobj) != null)
        {
View Full Code Here

 
  void extractVerbPPAux(DEPTree tree, Prob2DMap map)
  {
    int i, size = tree.size();
    DEPNode verb;
    SRLArc arc;
   
    tree.setDependents();
   
    for (i=1; i<size; i++)
    {
      verb = tree.get(i);
     
      if (MPLibEn.isVerb(verb.pos))
      {
        for (DEPNode arg : verb.getDependentNodeList())
        {
          if (!arg.isLabel(DEPLibEn.DEP_AGENT) && (arc = arg.getSHead(verb)) != null)
          {
            if (arg.isPos(CTLibEn.POS_IN) && PBLib.isCoreNumberedArgument(arc.getLabel()))
              map.add(verb.lemma, arg.lemma);
          }
        }
      }
    }
View Full Code Here

    s_heads.add(arc);
  }
 
  public void addSHead(DEPNode head, String label)
  {
    s_heads.add(new SRLArc(head, label));
  }
View Full Code Here

TOP

Related Classes of com.clearnlp.dependency.srl.SRLArc

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.