gpt4 book ai didi

se.lth.cs.srl.corpus.Yield.addAll()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 05:25:31 27 4
gpt4 key购买 nike

本文整理了Java中se.lth.cs.srl.corpus.Yield.addAll()方法的一些代码示例,展示了Yield.addAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yield.addAll()方法的具体详情如下:
包路径:se.lth.cs.srl.corpus.Yield
类名称:Yield
方法名:addAll

Yield.addAll介绍

暂无

代码示例

代码示例来源:origin: com.googlecode.mate-tools/srl

/**
 * Returns the yield of this word, ie the complete phrase that defines the argument,
 * with respect to the predicate. It follows algorithm 5.3 in Richard Johansson (2008), page 88
 * @param pred The predicate of the proposition, required to deduce the yield
 * @return the Yield
 */
public Yield getYield(Predicate pred,String argLabel,Set<Word> argSet){
  Yield ret=new Yield(pred,mySentence,argLabel);
  ret.add(this);
  if(pred==this) //If the predicate is the argument, we don't consider the yield
    return ret;
  for(Word child:children){
    if(!argSet.contains(child)){ //We don't branch down this child if 
      Collection<Word> subtree=getDominated(Arrays.asList(child));
      if(!subtree.contains(pred))
        ret.addAll(subtree);
    }
  }
  //ret.addAll(getDominated(children));
  return ret;
}

代码示例来源:origin: microth/PathLSTM

public Yield getYield(Word pred, String argLabel, Set<Word> argSet) {
  Yield ret = new Yield(pred, mySentence, argLabel);
  ret.add(this);
  if (pred.idx == this.idx) // If the predicate is the argument, we don't
                // consider the yield
    return ret;
  Set<Integer> args = new TreeSet<>();
  for (Word w : argSet)
    args.add(w.getIdx());
  for (Word child : children) {
    if (!args.contains(child.idx)) { // We don't branch down this child
                      // if
      Collection<Word> subtree = getDominated(Arrays.asList(child));
      boolean containspred = false;
      for (Word w : subtree)
        if (w.idx == pred.idx)
          containspred = true;
      if (!containspred)
        // if(!subtree.contains(mySentence.get(pred.idx)));
        ret.addAll(subtree);
    }
  }
  // ret.addAll(getDominated(children));
  return ret;
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com