gpt4 book ai didi

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

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

本文整理了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()]);
  }
}

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