本文整理了Java中net.sf.extjwnl.data.Word.getPointers()
方法的一些代码示例,展示了Word.getPointers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Word.getPointers()
方法的具体详情如下:
包路径:net.sf.extjwnl.data.Word
类名称:Word
方法名:getPointers
[英]Returns all the pointers of the synset that contains this word whose source is this word.
[中]返回包含该单词的语法集的所有指针,其源是该单词。
代码示例来源:origin: hltfbk/Excitement-Open-Platform
public Set<SensedWord> getNeighborSensedWords(WordNetRelation relation) throws WordNetException {
Set<SensedWord> sensedWords = new LinkedHashSet<SensedWord>();
if (relation.isLexical())
{
List<Pointer> pointers = wordObj.getPointers(ExtJwnlUtils.wordNetRelationToPointerType(relation));
for (Pointer pointer : pointers)
// add a new SensedWord made of the Word-cast of this pointer
sensedWords.add( new ExtJwnlSensedWord(((Word) pointer.getTarget()), dictionary));
}
return sensedWords;
}
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
/**
* This method updates RelatedForms of all LexicalEntries provided by the {@link LexicalEntryGenerator}
* @see LexicalEntry
* @see RelatedForm
*/
void updateRelatedForms() {
Map<Set<Word>, LexicalEntry> mappings = lexicalEntryGenerator.getLexemeGroupLexicalEntryMaping();
// Iterate over all lexemeGroups and update the RelatedForms of corresponding LexicalEntries
for(Set<Word> lexemeGroup : mappings.keySet()){
Set<RelatedForm> relatedForms = new LinkedHashSet<RelatedForm>();
// Iterate over every Lexeme and check for possible RelatedForms
for(Word lexeme : lexemeGroup) {
for(Pointer pointer : lexeme.getPointers()) {
if(pointerTypeRelTypeMappings.containsKey(pointer.getType().getKey())){
relatedForms.add(generateRelatedForm(pointer));
}
}
}
mappings.get(lexemeGroup).setRelatedForms(new ArrayList<RelatedForm>(relatedForms));
}
}
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
/**
* This method updates SenseRelations of the Sense associated with the consumed lexeme.
* @see Sense
* @see SenseRelation
* @see Word
*/
private void updateSenseRelations(Word lexeme) {
SenseGenerator senseGenerator = lexicalEntryGenerator.getSenseGenerator();
Sense sense = senseGenerator.getSense(lexeme);
List<SenseRelation> senseRelations = new LinkedList<SenseRelation>();
for(Pointer pointer : lexeme.getPointers()){
if(pointerTypeRelNameMappings.containsKey(pointer.getType().getKey())) {
senseRelations.add(createSenseRelation(pointer));
}
}
sense.setSenseRelations(senseRelations);
}
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
for (Pointer p : word.getPointers()) {
PointerTarget t = p.getTarget();
if (t instanceof Word) {
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
for (Pointer p : w.getPointers()) {
PointerTarget t = p.getTarget();
if (t instanceof Word) {
内容来源于网络,如有侵权,请联系作者删除!