本文整理了Java中net.sf.extjwnl.data.Word.getSynset()
方法的一些代码示例,展示了Word.getSynset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Word.getSynset()
方法的具体详情如下:
包路径:net.sf.extjwnl.data.Word
类名称:Word
方法名:getSynset
[英]Returns the synset associated with this word.
[中]返回与该单词关联的语法集。
代码示例来源:origin: net.sf.extjwnl/extjwnl
/**
* Two words are equal if their parent Synsets are equal and they have the same lemma
*/
public boolean equals(Object object) {
return (object instanceof Word)
&& ((Word) object).getSynset().equals(getSynset())
&& ((Word) object).getLemma().equals(getLemma());
}
代码示例来源:origin: extjwnl/extjwnl
/**
* Two words are equal if their parent Synsets are equal and they have the same lemma
*/
public boolean equals(Object object) {
return (object instanceof Word)
&& ((Word) object).getSynset().equals(getSynset())
&& ((Word) object).getLemma().equals(getLemma());
}
代码示例来源:origin: net.sf.extjwnl/extjwnl
public int hashCode() {
return getSynset().hashCode() ^ getLemma().hashCode();
}
代码示例来源:origin: extjwnl/extjwnl
/**
* Returns all the pointers of the synset that contains this word whose source is this word.
*/
public List<Pointer> getPointers() {
List<Pointer> result = new ArrayList<>(0);
for (Pointer pointer : getSynset().getPointers()) {
if (this.equals(pointer.getSource())) {
result.add(pointer);
}
}
return result;
}
代码示例来源:origin: extjwnl/extjwnl
public int hashCode() {
return getSynset().hashCode() ^ getLemma().hashCode();
}
代码示例来源:origin: net.sf.extjwnl/extjwnl
/**
* Returns all the pointers of the synset that contains this word whose source is this word.
*/
public List<Pointer> getPointers() {
List<Pointer> result = new ArrayList<>(0);
for (Pointer pointer : getSynset().getPointers()) {
if (this.equals(pointer.getSource())) {
result.add(pointer);
}
}
return result;
}
代码示例来源:origin: net.sf.extjwnl/extjwnl
protected int getSynsetType() {
int ss_type = getPOS().getId();
if (POS.ADJECTIVE == getSynset().getPOS() && getSynset().isAdjectiveCluster()) {
ss_type = POS.ADJECTIVE_SATELLITE_ID;
}
return ss_type;
}
代码示例来源:origin: extjwnl/extjwnl
protected int getSynsetType() {
int ss_type = getPOS().getId();
if (POS.ADJECTIVE == getSynset().getPOS() && getSynset().isAdjectiveCluster()) {
ss_type = POS.ADJECTIVE_SATELLITE_ID;
}
return ss_type;
}
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
@Override
public String transform(Pointer p)
{
Synset source;
PointerTarget pt = p.getSource();
if (pt instanceof Word) {
source = ((Word) pt).getSynset();
}
else {
source = (Synset) pt;
}
try {
return synsetToString.transform(source) + " -> "
+ synsetToString.transform(p.getTargetSynset());
}
catch (JWNLException e) {
throw new IllegalArgumentException(e);
}
}
}
代码示例来源:origin: net.sf.extjwnl/extjwnl
public String toString() {
return ResourceBundleSet.insertParams("[Word: {0} [Lemma: {1}] {2} [Index: {3}]]", new Object[]{getPOS(), getLemma(), getSynset(), getIndex()});
}
代码示例来源:origin: extjwnl/extjwnl
public String toString() {
return ResourceBundleSet.insertParams("[Word: {0} [Lemma: {1}] {2} [Index: {3}]]", new Object[]{getPOS(), getLemma(), getSynset(), getIndex()});
}
代码示例来源:origin: net.sf.extjwnl/extjwnl-utilities
private static int getSenseNo(final Word word) throws JWNLException {
final IndexWord iw = word.getDictionary().getIndexWord(word.getPOS(), word.getLemma());
for (int i = 0; i < iw.getSenses().size(); i++) {
if (iw.getSenses().get(i).getOffset() == word.getSynset().getOffset()) {
return i;
}
}
return -1;
}
代码示例来源:origin: extjwnl/extjwnl
private static int getSenseNo(final Word word) throws JWNLException {
final IndexWord iw = word.getDictionary().getIndexWord(word.getPOS(), word.getLemma());
for (int i = 0; i < iw.getSenses().size(); i++) {
if (iw.getSenses().get(i).getOffset() == word.getSynset().getOffset()) {
return i;
}
}
return -1;
}
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
@Override
public UnorderedPair<String> transform(Pointer p)
{
Synset source;
PointerTarget pt = p.getSource();
if (pt instanceof Word) {
source = ((Word) pt).getSynset();
}
else {
source = (Synset) pt;
}
try {
return new UnorderedPair<String>(
synsetToString.transform(source),
synsetToString.transform(p.getTargetSynset()));
}
catch (JWNLException e) {
throw new IllegalArgumentException(e);
}
}
}
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
public CachedSense(String senseId)
throws SenseInventoryException
{
super(senseId);
try {
word = wn.getWordBySenseKey(senseId);
synset = word.getSynset();
pos = wordNetPosToSiPos.transform(word.getPOS());
useCount = word.getUseCount();
}
catch (JWNLException e) {
throw new SenseInventoryException(e);
}
}
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
/**
* Given a WordNet sense key, returns the corresponding synset offset + POS
*
* @param senseKey
* @return
* @throws SenseInventoryException
*/
public String senseKeyToSynsetOffsetAndPos(String senseKey)
throws SenseInventoryException
{
try {
Word w = wn.getWordBySenseKey(senseKey);
if (w == null) {
throw new SenseInventoryException("Sense key " + senseKey
+ " not found");
}
return synsetToString.transform(w.getSynset());
}
catch (JWNLException e) {
throw new SenseInventoryException(e);
}
}
代码示例来源:origin: hltfbk/Excitement-Open-Platform
/**
* Ctor with an {@link Word} and a dictionary
* This Ctor is quicker than the other.
* @param jwiDictionary
* @throws WordNetException
*/
ExtJwnlSensedWord(Word wordObj, ExtJwnlDictionary extJwnlDictionary) throws WordNetException {
if (wordObj==null)
throw new WordNetException("wordObj is null!");
this.wordObj = wordObj;
this.synset = new ExtJwnlSynset(extJwnlDictionary, wordObj.getSynset());
this.word = wordObj.getLemma();
this.dictionary = extJwnlDictionary;
this.pos = ExtJwnlUtils.getWordNetPartOfSpeech( wordObj.getPOS());
}
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
net.sf.extjwnl.data.Synset lexemeSynset = lexeme.getSynset(); // lexemes Synset
sb.append(lexeme.getSynset().getPOS());
sb.append(" ");
sb.append(lexeme.getSenseKey());
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
if(lePOS.equals(EPartOfSpeech.verb)){
String[] frames = lexeme.getSynset().getVerbFrames();
for(String frame : frames){
Map<String, Word> codeLexeme = new TreeMap<String, Word>();
代码示例来源:origin: apache/opennlp-sandbox
+ sensekey
+ " : "
+ getDictionary().getWordBySenseKey(sensekey).getSynset()
.getGloss());
+ sensekey
+ " : "
+ getDictionary().getWordBySenseKey(sensekey).getSynset()
.getGloss());
} catch (JWNLException e) {
内容来源于网络,如有侵权,请联系作者删除!