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

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

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

Word.getSynset介绍

暂无

代码示例

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

/**
 * Get the synset that is a) the target of this pointer, or b) the     * synset that contains the target of this pointer.
 */
public Synset getTargetSynset() throws JWNLException {
  PointerTarget target = getTarget();
  if (target instanceof Word) {
    return ((Word) target).getSynset();
  } else {
    return (Synset) target;
  }
}

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

/**
 * If the target is a synset, return it, otherwise it's a word
 * so return the word's parent synset.
 */
public Synset getSynset() {
  if (isLexical()) {
    return ((Word)_target).getSynset();
  } else {
    return (Synset)_target;
  }
}

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

/** Two words are equal if their parent Synsets are equal and they have the same index */
public boolean equals(Object object) {
  return (object instanceof Word)
      && ((Word) object).getSynset().equals(getSynset())
      && ((Word) object).getIndex() == getIndex();
}

代码示例来源: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()]);
  }
}

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

public int hashCode() {
  return getSynset().hashCode() ^ getIndex();
}

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

public String toString() {
  if (_cachedToString == null) {
    Object[] params = new Object[]{getPOS(), getLemma(), getSynset(), new Integer(getIndex())};
    _cachedToString = JWNL.resolveMessage("DATA_TOSTRING_005", params);
  }
  return _cachedToString;
}

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

/**
 * Ctor with an {@link Word} and a dictionary
 * This Ctor is quicker than the other.
 * @param jwiDictionary 
 * @throws WordNetException 
 */
JwnlSensedWord(Word objWord, JwnlDictionary jwnlDictionary) throws WordNetException {
  this.wordObj = objWord;
  this.synset = new JwnlSynset(jwnlDictionary, objWord.getSynset());
  this.word = objWord.getLemma();
  this.dictionary = jwnlDictionary;
  this.pos = JwnlUtils.getWordNetPartOfSpeech( wordObj.getPOS());
}

相关文章