Examples of PBArg


Examples of com.clearnlp.propbank.PBArg

  {
    List<PBInstance> instances = PBLib.getPBInstanceList(propFile, treeDir, norm);
    List<PBInstance> remove = new ArrayList<PBInstance>();
    mergeLightVerbs(instances);
    CTTree tree;
    PBArg  aDSP;
   
    for (PBInstance instance : instances)
    {
      System.out.println(instance.getKey());
      tree = instance.getTree();
View Full Code Here

Examples of com.clearnlp.propbank.PBArg

    Map<String,PBInstance> mNouns = new HashMap<String,PBInstance>();
    List<PBInstance> lVerbs = new ArrayList<PBInstance>();
    List<PBInstance> remove = new ArrayList<PBInstance>();
    PBInstance nInst;
    List<PBArg> args;
    PBArg rel;
   
    for (PBInstance instance : instances)
    {
      if (instance.isVerbPredicate())
      {
        if (instance.roleset.endsWith("LV"))
          lVerbs.add(instance);
      }
      else
        mNouns.put(instance.getKey(), instance);
    }
   
    for (PBInstance instance : lVerbs)
    {
      nInst = null;
      args  = new ArrayList<PBArg>();
     
      for (PBArg arg : instance.getArgs())
      {
        if (arg.label.endsWith("PRR"))
          nInst = mNouns.get(instance.getKey(arg.getLoc(0).terminalId));
        else if (arg.label.startsWith("LINK") || arg.isLabel(PBLib.PB_ARG0))
          args.add(arg);
      }
     
      if (nInst == null)
      {
        StringBuilder build = new StringBuilder();
       
        build.append(ERR_LV);
        build.append(":");
        build.append(" ");
        build.append(instance.toString());
       
        System.err.println(build.toString());
        remove.add(instance);
      }
      else
      {
        nInst.addArgs(args);
        rel = nInst.getFirstArg(PBLib.PB_REL);
        rel.addLoc(new PBLoc(instance.predId, 0, ","));
       
        args.clear();
       
        for (PBArg arg : instance.getArgs())
        {
View Full Code Here

Examples of com.clearnlp.propbank.PBArg

  }
 
  private boolean findOverlappingArguments(PBInstance instance)
  {
    CTTree  tree = instance.getTree();
    PBArg ai, aj;
    IntOpenHashSet si, sj;
    int i, j, size = instance.getArgSize(), ni, nj;
    List<PBArg> lDel = new ArrayList<PBArg>();
   
    for (i=0; i<size; i++)
View Full Code Here

Examples of com.clearnlp.propbank.PBArg

  {
    CTTree tree = instance.getTree();
    CTNode node, comp, ante = null;
    String label;
    List<PBArg> lAdd = new ArrayList<PBArg>();
    PBArg nArg;
   
    for (PBArg arg : instance.getArgs())
    {
      for (PBLoc loc : arg.getLocs())
      {
        node  = tree.getNode(loc);
        label = null;
       
        if (node.pTag.startsWith("WH"))
        {
          if ((comp = CTLibEn.getComplementizer(node)) != null && (ante = comp.getAntecedent()) != null)
            label = PBLib.PB_LINK_SLC;
        }
        else if (node.isEmptyCategory())
        {
          if ((ante = node.getAntecedent()) != null)
          {
            if (node.form.equals(CTLibEn.EC_NULL))
              label = PBLib.PB_LINK_PSV;
            else if (node.form.equals(CTLibEn.EC_PRO))
              label = PBLib.PB_LINK_PRO;
          }
        }
       
        if (label != null)
        {
          nArg = new PBArg();
          nArg.label = label;
          nArg.addLoc(new PBLoc(ante.getPBLoc(), ""));
          nArg.addLoc(new PBLoc(node.getPBLoc(), "*"));
         
          lAdd.add(nArg);
        }
      }
    }
 
View Full Code Here

Examples of com.clearnlp.propbank.PBArg

    CTNode dsp = esm.getAntecedent();
    if (dsp == nulldsp = prn.getNearestAncestor("+S.*");
   
    if (dsp != null)
    {
      PBArg arg = new PBArg();
      arg.addLoc(dsp.getPBLoc());
      arg.label = max.o1.label+"-"+PBLib.PB_DSP;
      instance.removeArgs(max.o1.label);
     
      return arg;
    }
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.