net.didion.jwnl.data.Word.equals()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(102)

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

Word.equals介绍

[英]Two words are equal if their parent Synsets are equal and they have the same index
[中]如果两个单词的父语法集相等且索引相同,则它们是相等的

代码示例

代码示例来源:origin: hltfbk/Excitement-Open-Platform

@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (getClass() != obj.getClass())
    return false;
  JwnlSensedWord other = (JwnlSensedWord) obj;
  if (wordObj == null) {
    if (other.wordObj != null)
      return false;
  } else if (!wordObj.equals(other.wordObj))
    return false;
  return true;
}

代码示例来源:origin: net.sf.jwordnet/jwnl

/** returns all the pointers of the synset that contains this word whose source is this word */
  public Pointer[] getPointers() {
    Pointer[] source = getSynset().getPointers();
    List list = new ArrayList(source.length);
    for (int i = 0; i < source.length; ++i) {
      Pointer pointer = source[i];
      if (this.equals(pointer.getSource()))
        list.add(pointer);
    }
    return (Pointer[]) list.toArray(new Pointer[list.size()]);
  }
}

相关文章