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

x33g5p2x  于2022-02-05 转载在 其他  
字(1.0k)|赞(0)|评价(0)|浏览(104)

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

Yield.size介绍

暂无

代码示例

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

/**
 * Checks whether this yield is continuous, ie they contain all the words in
 * the sentence between this.first() and this.last(). Yields with 1 word are
 * always continuous
 * 
 * @return true if this yield is continuous, false otherwise
 */
public boolean isContinuous() {
  if (this.size() < 2)
    return true;
  int senIndex = this.first().idx;
  for (Word w : this) {
    if (w.idx != senIndex++)
      return false;
  }
  return true;
}

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

/**
 * Checks whether this yield is continuous, ie they contain all the words in the
 * sentence between this.first() and this.last(). Yields with 1 word are always continuous 
 * @return true if this yield is continuous, false otherwise
 */
public boolean isContinuous(){
  if(this.size()<2)
    return true;
  int senIndex=sen.indexOf(this.first());
  for(Word w:this){
    if(sen.get(senIndex++)!=w)
      return false;
  }
  return true;
}

相关文章